-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate AR to Github Actions #8886
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d0fc440
Add `ar-ci.sh` script to run AR build in Github Actions
ioannakok 4693b74
Ignore `dotcom-rendring` path when running AR build
ioannakok 5d2aad7
Fix paths in `contentDirectories` when uploading artifacts
ioannakok 241b4b6
Fix paths in `contentDirectories`
ioannakok a3a545f
Upload mobile-assets once in Riff-Raff
ioannakok 7017cb1
Zip only the contents of `dist/server` and not the file structure
ioannakok 83f2d35
Cache dependencies in the workflow
ioannakok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,73 @@ | ||
name: "AR CI" | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "dotcom-rendering/**" | ||
|
||
workflow_dispatch: | ||
|
||
# Allow queued workflows to interrupt previous runs | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
# Allow GitHub to request an OIDC JWT ID token, to use with aws-actions/configure-aws-credentials | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
# Checkout the repository | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Get the desired version of Node installed | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: yarn | ||
node-version-file: .nvmrc | ||
|
||
- name: Install dependencies | ||
run: | | ||
yarn --silent --frozen-lockfile | ||
|
||
# Execute some tasks from the `apps-rendering/package.json` file, using `yarn` | ||
- name: Build and package | ||
working-directory: apps-rendering | ||
run: | | ||
yarn test | ||
yarn build:client:prod | ||
yarn build:server:prod | ||
yarn copy-manifest | ||
yarn copy-fonts | ||
yarn synth | ||
zip -j dist/server/mobile-apps-rendering.zip dist/server/* | ||
|
||
- name: AWS Auth | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} | ||
aws-region: eu-west-1 | ||
|
||
- name: Upload to riff-raff | ||
uses: guardian/actions-riff-raff@v2.2.2 | ||
with: | ||
configPath: apps-rendering/riff-raff.yaml | ||
projectName: Mobile::mobile-apps-rendering | ||
buildNumberOffset: 27000 # This is the last build number from TeamCity | ||
contentDirectories: | | ||
mobile-apps-rendering-cfn: | ||
- apps-rendering/cdk.out/MobileAppsRendering-CODE.template.json | ||
- apps-rendering/cdk.out/MobileAppsRendering-PROD.template.json | ||
mobile-apps-rendering-preview-cfn: | ||
- apps-rendering/cdk.out/MobileAppsRenderingPreview-CODE.template.json | ||
- apps-rendering/cdk.out/MobileAppsRenderingPreview-PROD.template.json | ||
mobile-apps-rendering: | ||
- apps-rendering/dist/server/mobile-apps-rendering.zip | ||
mobile-assets: | ||
- apps-rendering/dist/assets/ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are replacing the deprecated
node-riffraff-artifact
withactions-riff-raff
.node-riffraff-artifact
was zipping under the hood the contents ofdist/server
and producingmobile-apps-rendering.zip
. We can verify this in its config file. We are now adding a command to do the same.The -j option in the command stores files with the given names only. The j option doesn't store directory information. This will produce structure:
which is the same as what current main produces.