Skip to content

Commit

Permalink
feat: CI (#64)
Browse files Browse the repository at this point in the history
* feat: CI

* fix: point to the Dockerfile
  • Loading branch information
LiquidLemon authored May 2, 2024
1 parent 7039d05 commit 4055b36
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build and push Docker image
on: push
jobs:
build-and-push-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build . -f docker/web/Dockerfile -t hspsh/whohacks
- run: echo "::set-output name=TAG::$(git describe --tags 2>/dev/null)"
name: Check if commit is tagged
id: check-tag
- if: ${{ steps.check-tag.outputs.TAG != '' }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ steps.check-tag.outputs.TAG != '' }}
name: Push image
run: |
TAG=${{ steps.check-tag.outputs.TAG }}
docker tag hspsh/whohacks ghcr.io/hspsh/whohacks:$TAG
docker push ghcr.io/hspsh/whohacks:$TAG

0 comments on commit 4055b36

Please sign in to comment.