Push to S3 #41
Workflow file for this run
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: Push to S3 | |
| on: | |
| release: | |
| types: [published, created] | |
| create: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| upload-to-s3: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Configure AWS credentials using OIDC | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/GitHubActionsS3Role | |
| aws-region: us-east-1 | |
| - name: Create and upload template.tar.gz | |
| run: | | |
| # Create tarball excluding .git and target directories | |
| # Write to /tmp to avoid modifying the source directory during archiving | |
| tar -czvf /tmp/template.tar.gz \ | |
| --exclude='.git' \ | |
| --exclude='target' \ | |
| . | |
| # Upload to S3 | |
| aws s3 cp /tmp/template.tar.gz s3://helix-repo/template.tar.gz | |
| - name: Upload completion notification | |
| if: success() | |
| run: | | |
| echo "Successfully uploaded template.tar.gz to S3 bucket: helix-repo" | |
| echo "Upload triggered by: ${{ github.event_name }}" | |
| echo "Reference: ${{ github.ref }}" |