forked from whimet/confluence-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.53 KB
/
release.yml
File metadata and controls
46 lines (42 loc) · 1.53 KB
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
# GitHub Actions Workflow created for handling the release process based on the draft release prepared
# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided.
name: Release
on:
release:
types: [prereleased, released]
jobs:
release:
name: ${{ github.event.release.tag_name }} to production
# environment: # It will wait for approval if we add an environment
# name: staging
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
# extract License from github.event.release.tag_name
LICENSE=$(echo ${{ github.event.release.tag_name }} | cut -d'-' -f2)
echo "::set-output name=license::$LICENSE"
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- name: yarn install
shell: bash
run: yarn install
- name: yarn build
shell: bash
run: yarn build:${{ steps.properties.outputs.license }}
- name: Publish
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages publish dist --branch production --project-name=conf-${{ steps.properties.outputs.license }}