Skip to content

Commit

Permalink
Added latest tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
AeonRemnant committed Sep 21, 2024
1 parent 39b60c2 commit 1e7b118
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ jobs:
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build Docker image
run: docker build -t heartflame-fleet:latest .
run: docker build -t heartflame-fleet:${{ github.sha }} .

- name: Tag Docker image as latest
if: github.ref == 'refs/heads/main'
run: docker tag heartflame-fleet:${{ github.sha }} heartflame-fleet:latest

- name: Scan Docker image with Trivy
uses: aquasecurity/trivy-action@0.20.0
Expand All @@ -60,8 +64,10 @@ jobs:
with:
sarif_file: 'trivy-results.sarif'

- name: Tag and Push Docker image to GHCR
- name: Push Docker image to GHCR
if: success()
run: |
docker tag heartflame-fleet:latest ghcr.io/heartflamesoftware/heartflame-fleet:${{ github.sha }}
docker push ghcr.io/heartflamesoftware/heartflame-fleet:${{ github.sha }}
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
docker push ghcr.io/heartflamesoftware/heartflame-fleet:latest
fi

0 comments on commit 1e7b118

Please # to comment.