Skip to content

Commit

Permalink
ci: test asset location
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Dec 11, 2023
1 parent 864ec03 commit f05b351
Showing 1 changed file with 42 additions and 39 deletions.
81 changes: 42 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,42 +92,42 @@ jobs:
# [ ! -f changes.md ] || gh pr comment ${{ github.event.number }} --body-file changes.md

# Compare and deploy to non-prod
deploy-nonprod:
needs: [build]
concurrency: deploy-nonprod-${{ github.head_ref }}

name: Deploy Nonprod
# if: github.ref == 'refs/heads/master' && github.event_name == 'push'
runs-on: ubuntu-latest
env:
CONFIG_PATH: ${{ needs.build.outputs.config_path }}
ASSETS_PATH: ${{ needs.build.outputs.assets_path }}

permissions:
id-token: write
contents: read

environment:
name: 'nonprod'
url: https://dev.basemaps.linz.govt.nz

steps:
- uses: actions/checkout@v4

- name: AWS Configure
uses: aws-actions/[email protected]
with:
aws-region: ap-southeast-2
mask-aws-account-id: true
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}

- name: Import config
run: |
./scripts/bmc.sh import --config ${CONFIG_PATH} --commit
# deploy-nonprod:
# needs: [build]
# concurrency: deploy-nonprod-${{ github.head_ref }}

# name: Deploy Nonprod
# # if: github.ref == 'refs/heads/master' && github.event_name == 'push'
# runs-on: ubuntu-latest
# env:
# CONFIG_PATH: ${{ needs.build.outputs.config_path }}
# ASSETS_PATH: ${{ needs.build.outputs.assets_path }}

# permissions:
# id-token: write
# contents: read

# environment:
# name: 'nonprod'
# url: https://dev.basemaps.linz.govt.nz

# steps:
# - uses: actions/checkout@v4

# - name: AWS Configure
# uses: aws-actions/[email protected]
# with:
# aws-region: ap-southeast-2
# mask-aws-account-id: true
# role-to-assume: ${{ secrets.AWS_ROLE_ARN }}

# - name: Import config
# run: |
# ./scripts/bmc.sh import --config ${CONFIG_PATH} --commit

# Compare and deploy to non-prod
deploy-prod:
needs: [build, deploy-nonprod]
needs: [build]
concurrency: deploy-prod-${{ github.head_ref }}

name: Deploy Production
Expand All @@ -149,12 +149,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: AWS Configure
uses: aws-actions/[email protected]
with:
aws-region: ap-southeast-2
mask-aws-account-id: true
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
# - name: AWS Configure
# uses: aws-actions/[email protected]
# with:
# aws-region: ap-southeast-2
# mask-aws-account-id: true
# role-to-assume: ${{ secrets.AWS_ROLE_ARN }}

- name: Download Config
run: |
Expand All @@ -164,6 +164,9 @@ jobs:
- name: Update config to production URLs
run: |
echo "ASSETS_LOCATION_PROD=s3://linz-basemaps/assets/${ASSETS_HASH}" >> ${GITHUB_ENV}
echo ${ASSETS_LOCATION_PROD}
# aws s3 cp assets-current.tar.co ${ASSETS_LOCATION_PROD}
./scripts/bmc.sh bundle --config $PWD/config-current.json.gz --output $PWD/config-prod.json --assets ${ASSETS_LOCATION_PROD}
Expand Down

0 comments on commit f05b351

Please sign in to comment.