diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 23b715a..3909bad 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -8,33 +8,3 @@ jobs: steps: - uses: linz/action-typescript@9bf69b0f313b3525d3ba3116f26b1aff7eb7a6c0 # v3.1.0 - - deploy-prod: - runs-on: ubuntu-latest - concurrency: deploy-prod-${{ github.ref }} - needs: [main] - if: github.ref == 'refs/heads/master' && github.repository == 'linz/lds-cache' - - permissions: - id-token: write - contents: write - - environment: - name: prod - - steps: - - uses: linz/action-typescript@9bf69b0f313b3525d3ba3116f26b1aff7eb7a6c0 # v3.1.0 - - - name: (Prod) Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4 - with: - aws-region: ap-southeast-2 - mask-aws-account-id: true - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - - - name: (Prod) Deploy - run: | - npx cdk deploy --require-approval never - env: - NODE_ENV: "production" - CACHE_BUCKET_NAME: "linz-lds-cache" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..c4b3be0 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,46 @@ +on: + push: + branches: + - master + +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + releases_created: ${{ steps.release.outputs.releases_created }} + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: node + token: ${{ secrets.GITHUB_TOKEN }} + + publish-release: + needs: release-please + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: write + + environment: + name: prod + + if: ${{ needs.release-please.outputs.releases_created }} + steps: + - uses: linz/action-typescript@9bf69b0f313b3525d3ba3116f26b1aff7eb7a6c0 # v3.1.0 + + - name: (Prod) Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4 + with: + aws-region: ap-southeast-2 + mask-aws-account-id: true + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + + - name: (Prod) Deploy + run: | + npx cdk deploy --require-approval never + env: + NODE_ENV: 'production' + CACHE_BUCKET_NAME: 'linz-lds-cache'