-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1193 from alphagov/add-build-and-create-pr-on-tags
Add build-image-on-tags and create-pr-on-tags actions
- Loading branch information
Showing
3 changed files
with
56 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,29 @@ | ||
name: Build and push images on tags | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'k[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build_and_push: | ||
name: datagovuk_find | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Login to GHCR | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.gitRef }} | ||
- name: Build and push images | ||
env: | ||
APP: datagovuk_find | ||
ARCH: amd64 | ||
GH_REF: ${{ github.ref_name }} | ||
run: ./docker/build-image.sh |
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,23 @@ | ||
name: Create charts PR on tags creation | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: [ "Build and push images on tags" ] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
create_pr: | ||
name: Create charts PR on tags creation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set GH_REF | ||
# Change back to git tag once we no longer need the k versions | ||
run: echo "GH_REF=`echo $(git fetch -t -q && git tag -l "k*" | sort --version-sort | tail -n1)`" >> $GITHUB_ENV | ||
- run: bash ./docker/create-pr.sh | ||
env: | ||
GH_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }} | ||
IS_TAG: "true" | ||
ENVS: "staging,production" |
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