-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: CI * fix: point to the Dockerfile
- Loading branch information
1 parent
7039d05
commit 4055b36
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
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
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 |