[GH-167] - Update PWS_HOST with new value from REQ7051889 (#168) #117
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: Create release tag, and deploy to dev | |
on: | |
push: | |
branches: | |
- main | |
- dry-run-create-release | |
env: | |
STEP_SCRIPTS: ${{ github.workspace }}/.github/steps/create-release | |
jobs: | |
configure-release: | |
runs-on: ubuntu-latest | |
outputs: | |
release-required: ${{ steps.get-release.outputs.release-required }} | |
version: ${{ steps.get-release.outputs.version }} | |
latest-release: ${{ steps.get-release.outputs.latest-release }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: ${STEP_SCRIPTS}/is-release-required.sh | |
id: get-release | |
name: Get version and determine release requirement | |
create-release: | |
needs: [configure-release] | |
if: needs.configure-release.outputs.release-required == 'true' | |
runs-on: ubuntu-latest | |
env: | |
version: ${{ needs.configure-release.outputs.version }} | |
concurrency: | |
group: ${{ github.repository }} | |
cancel-in-progress: false | |
permissions: | |
id-token: write | |
# https://docs.github.com/en/rest/reference/releases#create-a-release | |
# Creating "Release" artifacts falls under "contents: write" | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: UWIT-IAM/actions/[email protected] | |
with: | |
gcloud-token: ${{ secrets.GCR_TOKEN }} | |
- name: Install poetry | |
uses: abatilo/[email protected] | |
- run: | | |
sudo apt-get -y install jq | |
poetry run pip install uw-it-build-fingerprinter tox | |
- run: | | |
poetry run tox -e build-layers \ | |
-- -t ${{ env.version }} --release ${{ env.version }} --cache \ | |
--build-arg HUSKY_DIRECTORY_VERSION=${{ env.version }} | |
poetry run tox -e unit-tests | |
# Build layers with the -k option to avoid installing a lot of | |
# unnecessary dependencies. We can also skip black/flake8 for | |
# this phase, because the code has already been accepted into | |
# the repository. | |
name: Validate build | |
- name: Create release ${{ needs.configure-release.outputs.version }} | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ needs.configure-release.outputs.version }} | |
if: github.ref == 'refs/heads/main' | |
- run: docker push gcr.io/uwit-mci-iam/husky-directory:${{ env.version }} | |
if: github.ref == 'refs/heads/main' | |
- run: | | |
./scripts/deploy.sh -t dev -v ${{ env.version }} \ | |
${{ github.ref != 'refs/heads/main' && '-x' || '' }} |