-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into chore/update-env-va…
…riables
- Loading branch information
Showing
308 changed files
with
5,195 additions
and
2,414 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
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}} | ||
echo "DOCKER_REPOSITORY_FOR_REF=${DOCKER_REPOSITORY_FOR_REF}" >> $GITHUB_ENV | ||
- 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:/home/node/parabol/dist ./dist | ||
docker cp temp-container:/home/node/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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Migration Order | ||
on: | ||
pull_request: | ||
paths: | ||
- packages/server/postgres/migrations/*.ts | ||
jobs: | ||
migration-order: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout master | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: master | ||
|
||
- name: Get newest migration on master | ||
run: | | ||
MAX_OLD_MIGRATION=$(ls packages/server/postgres/migrations | tail -n 1) | ||
echo MAX_OLD_MIGRATION=$MAX_OLD_MIGRATION >> $GITHUB_ENV | ||
- name: Checkout PR | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get new migrations | ||
id: new-migrations | ||
uses: tj-actions/changed-files@v40 | ||
with: | ||
files: packages/server/postgres/migrations/*.ts | ||
|
||
- name: Check migration conflicts | ||
run: | | ||
for file in ${{ steps.new-migrations.outputs.added_files }}; do | ||
FILE_NAME=$(basename $file) | ||
if [[ "$FILE_NAME" < "${{ env.MAX_OLD_MIGRATION }}" ]]; then | ||
echo "$FILE_NAME predates ${{ env.MAX_OLD_MIGRATION}}. Please rename it" | ||
exit 1 | ||
else | ||
echo "$FILE_NAME does not conflict with existing migrations on master" | ||
fi | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
on: | ||
push: | ||
branches: | ||
- release | ||
- master | ||
- hotfix-* | ||
name: release-please | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate a token | ||
id: generate_token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.RELEASE_BOT_APP_ID }} | ||
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} | ||
- uses: google-github-actions/release-please-action@v3 | ||
with: | ||
command: manifest | ||
default-branch: release | ||
default-branch: ${{ github.ref_name}} | ||
release-type: node | ||
token: ${{ steps.generate_token.outputs.token }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Release | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- hotfix-* | ||
types: [closed] | ||
jobs: | ||
release: | ||
if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release-please--') }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup environment variables | ||
run: | | ||
ACTION_VERSION=$(grep '"version":' package.json | cut -d\" -f4) | ||
echo "ACTION_VERSION=${ACTION_VERSION}" >> $GITHUB_ENV | ||
- 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 }} | ||
- name: "Set up Cloud SDK" | ||
uses: "google-github-actions/setup-gcloud@v1" | ||
- name: "Tag image with production version" | ||
run: |- | ||
gcloud container images add-tag -q \ | ||
${{ secrets.GCP_AR_PARABOL_DEV }}:${{github.event.pull_request.head.sha}} \ | ||
${{ secrets.GCP_AR_PARABOL }}:v${{ env.ACTION_VERSION }} | ||
- name: Bump version in GitLab | ||
run: | | ||
curl "https://gitlab.com/api/v4/projects/${{ vars.GITLAB_PROJECT_ID }}/repository/commits" \ | ||
--request POST \ | ||
--header 'PRIVATE-TOKEN: ${{ secrets.GITLAB_API_TOKEN }}' \ | ||
--form "branch=main" \ | ||
--form "commit_message=release v${{ env.ACTION_VERSION }}" \ | ||
--form "actions[][action]=update" \ | ||
--form "actions[][file_path]=version.yaml" \ | ||
--form "actions[][content]= | ||
# Change it to use a valid docker tag, which are the same of the GitHub tags. Ex: v6.110.0 | ||
applicationVersion: &applicationVersion v${{ env.ACTION_VERSION }} | ||
global: | ||
image: | ||
tag: *applicationVersion" |
Oops, something went wrong.