Skip to content

Commit

Permalink
testing release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mobileoverlord committed Jun 28, 2024
1 parent 670d914 commit 25fe813
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
79 changes: 79 additions & 0 deletions .github/workflows/build_push_release.yml
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 }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# peridiod releases

## 2.5.4-dev

* Enhancements
* Here is an enhancement
* Bug Fixes
* Here is a bug fix

## v2.5.3

* Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.3
2.5.4-dev

0 comments on commit 25fe813

Please sign in to comment.