Skip to content

Commit 3ec2086

Browse files
committed
chore: update github actions
1 parent 8bae43e commit 3ec2086

24 files changed

+472
-737
lines changed

.github/OLD/docs-preview.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy docs PR preview
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/docs-preview.yml
7+
- website/**
8+
9+
permissions:
10+
contents: read
11+
deployments: write
12+
id-token: write
13+
14+
env:
15+
SLUG: ssl-pinning-${{ github.event.number }}-${{ github.run_id }}
16+
17+
defaults:
18+
run:
19+
working-directory: website
20+
21+
jobs:
22+
deploy:
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 15
25+
environment:
26+
name: preview-${{ github.event.number }}
27+
url: https://${{ env.SLUG }}.ionicpreview.com
28+
steps:
29+
- uses: actions/checkout@v3
30+
31+
- name: 'Setup Tools'
32+
uses: ./.github/actions/setup-tools
33+
34+
- name: Build
35+
run: pnpm run build-docs
36+
37+
- uses: aws-actions/configure-aws-credentials@v1
38+
with:
39+
role-to-assume: arn:aws:iam::319312831725:role/github-docs
40+
aws-region: us-east-1
41+
42+
- name: Deploy
43+
run: |
44+
aws s3 sync build/ s3://ionic-docs/preview/${{ env.SLUG }}/ --exclude '*.html' --cache-control max-age=31536000 --only-show-errors
45+
aws s3 sync build/ s3://ionic-docs/preview/${{ env.SLUG }}/ --exclude '*' --include '*.html' --cache-control max-age=60 --only-show-errors

.github/OLD/docs-production.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy docs to production
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
paths:
9+
- .github/workflows/docs-production.yml
10+
- website/**
11+
12+
permissions:
13+
contents: read
14+
deployments: write
15+
id-token: write
16+
17+
env:
18+
SLUG: ssl-pinning
19+
20+
defaults:
21+
run:
22+
working-directory: website
23+
24+
jobs:
25+
deploy:
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 15
28+
environment:
29+
name: production
30+
url: https://ionic.io/docs/${{ env.SLUG }}
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- name: 'Setup Tools'
35+
uses: ./.github/actions/setup-tools
36+
37+
- name: Build
38+
run: pnpm run build-docs
39+
40+
- uses: aws-actions/configure-aws-credentials@v1
41+
with:
42+
role-to-assume: arn:aws:iam::319312831725:role/github-docs
43+
aws-region: us-east-1
44+
45+
- name: Deploy
46+
run: |
47+
aws s3 sync build/ s3://ionic-docs/production/${{ env.SLUG }}/ --exclude '*.html' --cache-control max-age=31536000 --only-show-errors
48+
aws s3 sync build/ s3://ionic-docs/production/${{ env.SLUG }}/ --exclude '*' --include '*.html' --cache-control max-age=60 --only-show-errors
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 'Setup Tools'
2+
description: 'Setup tools needed in repo'
3+
4+
inputs:
5+
skip-install-on-cache-hit:
6+
description: 'If a Cache Hit happens, skip pnpm install'
7+
required: true
8+
default: 'false'
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Install Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 20
17+
18+
- name: Install PNPM
19+
uses: pnpm/action-setup@v2
20+
id: pnpm-install
21+
with:
22+
version: 8
23+
run_install: false
24+
25+
- name: Get pnpm store directory
26+
id: pnpm-cache
27+
shell: bash
28+
run: |
29+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV
30+
31+
- name: Setup PNPM cache
32+
id: cache-pnpm-store
33+
uses: actions/cache@v3
34+
env:
35+
STORE_PATH: ${{ env.STORE_PATH }}
36+
with:
37+
path: ${{ env.STORE_PATH }}
38+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
39+
restore-keys: |
40+
${{ runner.os }}-pnpm-store-
41+
42+
- name: Install dependencies
43+
if: inputs.skip-install-on-cache-hit == 'false' || (inputs.skip-install-on-cache-hit == 'true' && steps.cache-pnpm-store.cache-hit == 'false')
44+
shell: bash
45+
run: pnpm install

.github/workflows/basic-tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Basic Tests"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- 'synchronize'
7+
- 'opened'
8+
9+
jobs:
10+
setup:
11+
uses: ./.github/workflows/reusable_setup.yml
12+
secrets:
13+
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
14+
15+
lint-test:
16+
needs: 'setup'
17+
uses: ./.github/workflows/reusable_lint-packages.yml
18+
secrets:
19+
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
20+
21+
verify-packages:
22+
needs: 'setup'
23+
uses: ./.github/workflows/reusable_verify-packages.yml
24+
secrets:
25+
CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}

0 commit comments

Comments
 (0)