add docker workflow #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker main build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: docker-main | |
cancel-in-progress: true | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build the new image | |
run: docker build . -t ghcr.io/zeuswpi/haldis:${{ github.sha }} | |
- name: Tag the new image with latest | |
run: docker tag ghcr.io/zeuswpi/haldis:${{ github.sha }} ghcr.io/zeuswpi/haldis:latest | |
- name: Push Docker image | |
run: docker push --all-tags ghcr.io/zeuswpi/haldis |