Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
souramoo authored Apr 7, 2022
1 parent 18c65c5 commit 0ea3c1a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Build image and push to Docker Hub and GitHub Container Registry
uses: docker/build-push-action@v2
with:
context: .
tags: |
caroga/commentoplusplus:latest
caroga/commentoplusplus:"${{ steps.date.outputs.date }}"
caroga/commentoplusplus:"${{ steps.previoustag.outputs.tag }}"
ghcr.io/souramoo/commentoplusplus:latest
ghcr.io/souramoo/commentoplusplus:"${{ steps.date.outputs.date }}"
ghcr.io/souramoo/commentoplusplus:"${{ steps.previoustag.outputs.tag }}"
# build on feature branches, push only on main branch
push: ${{ github.ref == 'refs/heads/main' }}
platforms: amd64,arm,arm64,riscv64

0 comments on commit 0ea3c1a

Please sign in to comment.