-
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
c45fac3
commit 00a8299
Showing
1 changed file
with
46 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,46 @@ | ||
name: Release images Alt | ||
on: | ||
pull_request: | ||
|
||
env: | ||
# Use docker.io for Docker Hub if empty | ||
REGISTRY: ghcr.io | ||
# github.repository as <account>/<repo> | ||
IMAGE_BASE: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
name: Build and release images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- id: createImageTag | ||
name: Create image tag | ||
run: | | ||
IMAGE_TAG=$(echo ${{ github.event.release.tag_name }} | sed 's/v//') | ||
echo "{imageTag}={$IMAGE_TAG}" >> $GITHUB_OUTPUT | ||
- id: createImageBase | ||
run: | | ||
echo "imageBase=${IMAGE_BASE,,}" >> $GITHUB_OUTPUT | ||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and release Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: build/images/Dockerfile.go-toolset | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{steps.createImageBase.outputs.imageBase}}/go-toolset:test |