-
Notifications
You must be signed in to change notification settings - Fork 468
50 lines (47 loc) · 1.44 KB
/
publish-snapshot.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Publish Snapshot
on:
push:
branches:
- "snapshot-*"
workflow_dispatch: {}
permissions:
id-token: write
contents: read
jobs:
publish:
name: publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Get kubectl version
run: |
source hack/lib/kubectl-version.sh
echo "Using kubectl ${KUBECTL_VERSION}"
echo "KUBECTL_VERSION=$KUBECTL_VERSION" >> $GITHUB_ENV
- uses: azure/setup-kubectl@v4
with:
version: "${{ env.KUBECTL_VERSION }}"
id: install
- name: Get AWS credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-duration-seconds: 900
aws-region: ${{ secrets.AWS_REGION }}
role-session-name: GithubActionsSession-publish
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Run publish
env:
SNAPSHOT_BUCKET: "${{ secrets.SNAPSHOT_BUCKET }}"
SNAPSHOT_CLOUDFRONT: "${{ secrets.SNAPSHOT_CLOUDFRONT }}"
BRANCH: ${{ steps.extract_branch.outputs.branch }}
run: |
bash hack/publish-snapshot.sh