-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f46c64
commit 2a3ada4
Showing
2 changed files
with
54 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,20 @@ | ||
name: On Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
IMAGE_NAME: ghcr.io/tapalogi/docker-baseimage-musl | ||
DOCKER_BUILDKIT: 1 | ||
|
||
jobs: | ||
docker-build-test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Test Docker Build | ||
run: | | ||
# Build Image | ||
docker build --pull -f Dockerfile -t $IMAGE_NAME . |
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,34 @@ | ||
name: On Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
IMAGE_NAME: ghcr.io/tapalogi/docker-baseimage-musl | ||
DOCKER_BUILDKIT: 1 | ||
|
||
jobs: | ||
docker-publish-stable: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build & Publish | ||
run: | | ||
# Build Image | ||
docker build --pull -f Dockerfile -t docker-image . | ||
# Login Github Docker Registry | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
# Github Package Registry Tag & Push | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
echo IMAGE_NAME=$IMAGE_NAME | ||
echo VERSION=$VERSION | ||
docker tag docker-image $IMAGE_NAME:$VERSION | ||
docker push $IMAGE_NAME:$VERSION | ||
VERSION=latest | ||
docker tag docker-image $IMAGE_NAME:$VERSION | ||
docker push $IMAGE_NAME:$VERSION |