Ironbank Image Upload #3
Workflow file for this run
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: Ironbank S3 Upload | |
on: | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: "Version number of the Parabol image to process" | |
required: true | |
jobs: | |
pull-and-upload: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup environment variables | |
run: | | |
DOCKER_REPOSITORY_FOR_REF=${{ secrets.GCP_AR_PARABOL}} | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v3 | |
- id: "auth" | |
name: "Authenticate to Google Cloud" | |
uses: "google-github-actions/auth@v1" | |
with: | |
token_format: "access_token" | |
workload_identity_provider: ${{ secrets.GCP_WI_PROVIDER_NAME }} | |
service_account: ${{ secrets.GCP_SA_EMAIL }} | |
- uses: "docker/login-action@v2" | |
with: | |
registry: ${{ secrets.GCP_DOCKER_REGISTRY }} | |
username: "oauth2accesstoken" | |
password: "${{ steps.auth.outputs.access_token }}" | |
- name: Pull Docker image from GCP | |
run: docker pull ${{ env.DOCKER_REPOSITORY_FOR_REF }}:v${{ github.event.inputs.version_number }} | |
- name: Create temporary container | |
run: | | |
docker create --name temp-container ${{ env.DOCKER_REPOSITORY_FOR_REF }}:v${{ github.event.inputs.version_number }} | |
- name: Copy files from container | |
run: | | |
docker cp temp-container:/parabol/dist ./dist | |
docker cp temp-container:/parabol/build ./build | |
- name: Zip the files | |
run: zip -r ${{ github.event.inputs.version_number }}.zip dist build | |
- name: Set up AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.IRONBANK_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.IRONBANK_AWS_SECRET_ACCESS_KEY }} | |
aws-region: "us-east-1" | |
- name: Upload to S3 | |
run: | | |
aws s3 cp ${{ github.event.inputs.version_number }}.zip s3://ironbank-proving-ground-action-files.parabol.co/${{ github.event.inputs.version_number }}.zip |