diff --git a/.github/workflows/deploy-docker-tag.yml b/.github/workflows/deploy-docker-tag.yml new file mode 100644 index 0000000..3e6b6a3 --- /dev/null +++ b/.github/workflows/deploy-docker-tag.yml @@ -0,0 +1,40 @@ +name: Docker Image CI (Upload Tag) + +on: + push: + tags: + - 'v*' + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Buildx + uses: docker/setup-buildx-action@v1 + + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: amirpourmand/al-folio + + - name: Login + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 322c19a..b747dfc 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -3,8 +3,6 @@ name: Docker Image CI on: push: branches: [ master ] - pull_request: - branches: [ master ] jobs: @@ -12,7 +10,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'alshedivat' - + steps: - name: Checkout uses: actions/checkout@v2 @@ -24,7 +22,7 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - + - name: Build and push uses: docker/build-push-action@v2 with: