forked from theinterned/batucada
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow to build docker image and push to registry
- Loading branch information
Showing
1 changed file
with
35 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,35 @@ | ||
name: Builde docker image | ||
|
||
on: | ||
push: | ||
branches: ['**'] | ||
pull_request: | ||
branches: ['**'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- run: echo "IMAGE_TAG=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV | ||
|
||
- name: Build docker image | ||
run: docker build -t p2pu/lernanta:${IMAGE_TAG} . | ||
|
||
- name: log into registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: push docker image | ||
run: | | ||
docker tag p2pu/lernanta:${IMAGE_TAG} ghcr.io/p2pu/lernanta:${IMAGE_TAG} | ||
docker push ghcr.io/p2pu/lernanta:${IMAGE_TAG} |