-
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
670d914
commit 25fe813
Showing
3 changed files
with
87 additions
and
1 deletion.
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,79 @@ | ||
name: Build and Push Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
create_release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set Env | ||
run: | | ||
VERSION=$(echo "${GITHUB_REF#refs/*/}" | sed 's/^v//') | ||
echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
install: true | ||
|
||
- name: Build Docker image for amd64 | ||
run: | | ||
docker buildx build --platform linux/amd64 --output type=local,dest=docker_output/ -t peridiod:${RELEASE_TAG} -f support/Containerfile-release.amd64 . | ||
- name: Create GitHub Release | ||
id: create_release | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release create $RELEASE_TAG \ | ||
--title $RELEASE_TAG \ | ||
--notes "$(awk "/## $RELEASE_TAG/{flag=1;next}/##/{flag=0}flag" CHANGELOG.md)" | ||
- name: Upload Release Asset | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release upload ${{ github.ref }} ./docker_output/amd64/peridiod-${{ env.RELEASE_VERSION }}.tar.gz --clobber | ||
- name: Load docker hub credentials | ||
id: op-load-docker-hub-credentials | ||
uses: 1password/load-secrets-action@v1 | ||
env: | ||
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | ||
DOCKER_HUB_USERNAME: op://ci-cd/docker-hub-machine/username | ||
DOCKER_HUB_PASSWORD: op://ci-cd/docker-hub-machine/password | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ steps.op-load-docker-hub-credentials.outputs.DOCKER_HUB_USERNAME }} | ||
password: ${{ steps.op-load-docker-hub-credentials.outputs.DOCKER_HUB_PASSWORD }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64/v8 | ||
push: true | ||
tags: | | ||
peridio/peridiod:${{ github.ref_name }} | ||
peridio/peridiod:latest | ||
- name: Image digest | ||
id: image_digest | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: peridio/peridiod | ||
|
||
- name: Output image digest | ||
run: echo ${{ steps.image_digest.outputs.digest }} |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
2.5.3 | ||
2.5.4-dev |