diff --git a/.github/workflows/publish-docker-image-on-release.yml b/.github/workflows/publish-docker-image-on-release.yml new file mode 100644 index 0000000..f8f25af --- /dev/null +++ b/.github/workflows/publish-docker-image-on-release.yml @@ -0,0 +1,31 @@ +name: Publish Docker Image On Release + +on: + push: + tags: + - 'v*' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: nevermendel/docker-xelatex-awesome-cv + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index bfa9b65..4e371d4 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -4,8 +4,6 @@ on: push: branches: - 'master' - tags: - - 'v*' pull_request: branches: - 'master' @@ -16,11 +14,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Docker meta - id: meta - uses: docker/metadata-action@v3 - with: - images: nevermendel/docker-xelatex-awesome-cv - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v1 @@ -32,5 +25,4 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + tags: nevermendel/docker-xelatex-awesome-cv:latest \ No newline at end of file