Skip to content

Commit b466543

Browse files
Add scripts for pushing images and creating a release (#12)
* Create easy release scripts for staging and production * Update staging URLs * Log into image registry * Change production target Helm repository * Remove individual build/publish workflows in favor of the new combined one * Pin versions of Railpack container images and copy them to local repository on release * Move Geddes special case into source code instead of patching and building a separate image --------- Co-authored-by: Emma Zheng <zheng861@purdue.edu> Fix syntax error and give GITHUB_TOKEN write access Create new buildx builder to allow remote registry caching Fix typo
1 parent 0273f5e commit b466543

26 files changed

Lines changed: 374 additions & 326 deletions

.github/workflows/build-publish-anvilops.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/build-publish-db-migrate-image.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/build-publish-dockerfile-builder.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/build-publish-filebrowser.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/build-publish-helm-deployer.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/build-publish-log-shipper.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/build-publish-railpack-builder.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/build-publish-staging-anvilops.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/copy-railpack-frontend-image.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
environment:
5+
description: "Environment"
6+
required: true
7+
default: "staging"
8+
type: choice
9+
options:
10+
- staging
11+
- production
12+
version:
13+
description: "Version number (production only)"
14+
required: false
15+
type: string
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
if: ${{ inputs.environment }}
23+
steps:
24+
- name: Clone repository
25+
uses: actions/checkout@v6
26+
27+
- name: Log in to image registry (Production)
28+
if: ${{ inputs.environment == 'production' }}
29+
run: docker login -u '${{ secrets.DOCKER_USERNAME }}' -p '${{ secrets.DOCKER_PASSWORD }}' registry.anvil.rcac.purdue.edu
30+
31+
- name: Log in to image registry (Staging)
32+
if: ${{ inputs.environment == 'staging' }}
33+
run: docker login -u '${{ secrets.DOCKER_USERNAME_STAGING }}' -p '${{ secrets.DOCKER_PASSWORD_STAGING }}' registry.anvil.rcac.purdue.edu
34+
35+
# This step is necessary because our script uses the destination OCI registry as a layer cache, which isn't supported by Docker out of the box.
36+
# See https://docs.docker.com/build/cache/backends/registry/ and https://docs.docker.com/build/builders/drivers/ for more info.
37+
- name: Set up buildx builder
38+
run: |
39+
docker buildx create --use
40+
docker buildx inspect --bootstrap
41+
42+
- name: Release
43+
run: ./.github/workflows/scripts/release-${{ inputs.environment }}.sh "${{ inputs.version }}"
44+
env:
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Log out of container registry
48+
if: always()
49+
run: docker logout registry.anvil.rcac.purdue.edu

0 commit comments

Comments
 (0)