feat(ci): Update deploy workflows to use gar #320
Workflow file for this run
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
name: Pull request validation workflow | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- labeled | |
paths-ignore: | |
- '**.md' | |
env: | |
STEP_SCRIPTS: ${{ github.workspace }}/.github/steps/pull-request | |
jobs: | |
update-pr-branch-version: | |
runs-on: ubuntu-latest | |
outputs: | |
new-version: ${{ steps.update-version.outputs.new-version }} | |
steps: | |
- name: Python Poetry Action | |
run: pipx install poetry | |
- uses: uwit-iam/actions/require-semver-guidance-label@0.1 | |
id: guidance | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: uwit-iam/actions/update-pr-branch-version@0.1.20 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
version-guidance: ${{ steps.guidance.outputs.guidance }} | |
id: update-version | |
validate-image-quality: | |
permissions: | |
contents: write | |
id-token: write | |
pull-requests: write | |
needs: [update-pr-branch-version] | |
runs-on: ubuntu-latest | |
env: | |
APP_VERSION: ${{ needs.update-pr-branch-version.outputs.new-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Run uwit-iam/action-setup-poetry-project | |
uses: uwit-iam/action-setup-poetry-project@main | |
with: | |
credentials: "${{ secrets.MCI_GCLOUD_AUTH_JSON }}" | |
enable_private_docker: true | |
- run: | | |
sudo apt-get -y install jq | |
poetry run pip install tox uw-it-build-fingerprinter | |
poetry run tox -e build-layers | |
- name: Run validation checks and tests | |
run: poetry run tox -e black,flake8,unit-tests | |
id: run-validations | |
- name: Cache fingerprinted layers | |
run: ./scripts/build.sh --cache | |
- name: Push tag for pull request | |
run: ${STEP_SCRIPTS}/create-pr-tag.sh -s ${{ env.source_image }} | |
id: create-pr-tag | |
env: | |
source_image: us-docker.pkg.dev/uwit-mci-iam/containers/husky-directory.app:tox | |
- uses: mshick/add-pr-comment@v1 | |
env: | |
PR_TAG: ${{ steps.create-pr-tag.outputs.image }} | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
repo-token-user-login: 'github-actions[bot]' | |
allow-repeats: false | |
message: | | |
Download and run the latest build with: | |
``` | |
./scripts/run-development-server.sh -i ${{ env.PR_TAG }} | |
``` |