trying to fix sha #7
This file contains hidden or 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: Build Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-image: | |
| name: Build the DBT Image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: type=sha,format=long | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: "${{ steps.meta.outputs.tags }}" | |
| labels: ${{ steps.meta.outputs.labels }} | |
| deploy-cloudformation: | |
| name: Deploy CloudFormation Stack | |
| runs-on: ubuntu-latest | |
| needs: build-image | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: aws-actions/setup-sam@v2 | |
| with: | |
| use-installer: true | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v2 | |
| with: | |
| aws-region: us-east-1 | |
| role-to-assume: 'arn:aws:iam::144406111952:role/Deployer' | |
| role-session-name: Deploy | |
| - name: Deploy stack | |
| run: > | |
| sam deploy --parameter-overrides \ | |
| SubnetIds=subnet-d30953b4,subnet-3b103115 \ | |
| VpcId=vpc-27ccbb5d \ | |
| ImageTag=sha-${{ github.sha }} | |