re-usable workflow #67
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: Deploy Dev | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: main | ||
jobs: | ||
dev: | ||
Check failure on line 9 in .github/workflows/deploy-dev.yml GitHub Actions / Deploy DevInvalid workflow file
|
||
uses: ./.github/workflows/deploy.yml | ||
with: | ||
stage: dev | ||
# env: | ||
# aws_account_id: ${{ vars.AWS_ACCOUNT_ID }} | ||
# aws_region: ${{ vars.AWS_REGION }} | ||
# aws_role: ${{ vars.AWS_ROLE }} | ||
# stage: dev | ||
# jobs: | ||
# setup: | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# sha_short: ${{ steps.set_sha.outputs.GITHUB_SHA_SHORT }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - id: set_sha | ||
# run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_OUTPUT | ||
# build: | ||
# needs: setup | ||
# env: | ||
# app_folder: src/ | ||
# app_zip_path: ${{ needs.setup.outputs.sha_short }}-lambda.zip | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# app_zip_path: ${{ steps.set-zip-path.outputs.APP_ZIP_PATH }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
# - name: Build | ||
# run: | | ||
# cd ${{ env.app_folder }} | ||
# npm install | ||
# - name: Zip | ||
# run: | | ||
# cd ${{ env.app_folder }} | ||
# zip -r ${{ env.app_zip_path }} * | ||
# - name: Upload build artefact | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: zipped-code | ||
# path: ${{ env.app_folder }}/${{ env.app_zip_path }} | ||
# - id: set-zip-path | ||
# run: echo "APP_ZIP_PATH=$(echo ${{ env.app_zip_path }})" >> $GITHUB_OUTPUT | ||
# deploy: | ||
# runs-on: ubuntu-latest | ||
# needs: build | ||
# permissions: | ||
# id-token: write | ||
# contents: read | ||
# outputs: | ||
# api_gateway_url: ${{ steps.action.outputs.API_GATEWAY_URL }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
# - name: Download a single artifact | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: zipped-code | ||
# path: tf | ||
# - name: Configure AWS Credentials | ||
# uses: aws-actions/configure-aws-credentials@v4 | ||
# with: | ||
# aws-region: ${{ env.aws_region }} | ||
# role-to-assume: arn:aws:iam::${{ env.aws_account_id }}:role/${{ env.aws_role }} | ||
# role-session-name: GitHubActions | ||
# - name: Init | ||
# shell: bash | ||
# run: | | ||
# cd tf | ||
# terraform init | ||
# - name: Select Workspace | ||
# shell: bash | ||
# run: | | ||
# cd tf | ||
# terraform workspace select -or-create ${{ env.stage }} | ||
# terraform init | ||
# - name: Action | ||
# shell: bash | ||
# id: action | ||
# run: | | ||
# cd tf | ||
# terraform apply -auto-approve -var function-stage=${{ env.stage }} -var lambda-zip-path=${{ needs.build.outputs.app_zip_path }} | ||
# echo "API_GATEWAY_URL=$(terraform output -raw api_gateway_url)" >> $GITHUB_OUTPUT | ||
# test: | ||
# needs: deploy | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - run: echo url is ${{ needs.deploy.outputs.api_gateway_url }} | ||
# shell: bash |