Skip to content

Commit

Permalink
Upgrade and fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukancagatay committed May 2, 2024
1 parent c8cc2bf commit eb13c46
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
name: build-and-push-on-tags
name: build-latest
on:
workflow_dispatch:
push:
tags:
- "*"
paths-ignore:
- LICENSE
- docker-compose.yml
# branches:
# - main

jobs:
build-push-latest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Get version from Dockerfile
id: version_provider
run: |
VERSION=$(grep 'ARG BASE_VERSION' Dockerfile | awk -F= '{print $2}')
echo "::set-output name=version::$VERSION"
- name: debug
run: |
echo "::debug:: ${{steps.version_provider.outputs.version}}"
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/main' }}
cache-from: |
dcagatay/emailrelay:latest
tags: |
dcagatay/emailrelay:latest
dcagatay/emailrelay:${{steps.version_provider.outputs.version}}
- name: Update repo description
uses: peter-evans/dockerhub-description@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: dcagatay/emailrelay
35 changes: 35 additions & 0 deletions .github/workflows/build-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build-tags
on:
workflow_dispatch:
push:
tags:
- "*"

jobs:
build-push-tags:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
cache-from: |
dcagatay/emailrelay:latest
tags: |
dcagatay/emailrelay:${{ github.ref_name }}
32 changes: 0 additions & 32 deletions .github/workflows/build.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/update-docker-hub-readme.yml

This file was deleted.

0 comments on commit eb13c46

Please sign in to comment.