-
Notifications
You must be signed in to change notification settings - Fork 99
84 lines (69 loc) · 2.15 KB
/
release.yml
File metadata and controls
84 lines (69 loc) · 2.15 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: phoenix-release
on:
workflow_dispatch:
inputs:
release_type:
type: choice
required: true
description: Type of the next version update to be released
options: [patch, minor, major, pre, graduate]
default: patch
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
version: ${{ steps.get_version.outputs.version }}
strategy:
matrix:
node-version: [24]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Setup
run: |
yarn install
# Configure git for pushing to GitHub during release.
git config user.name github-actions
git config user.email github-actions@github.com
- name: Release
run: yarn release:${{ inputs.release_type }} --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get released version
id: get_version
run: echo "version=$(node -p "require('./lerna.json').version")" >> "$GITHUB_OUTPUT"
push-to-docker:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: v${{ needs.release.outputs.version }}
- name: Docker Hub Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Docker Buildx Setup
uses: docker/setup-buildx-action@v3
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/phoenix:latest
${{ secrets.DOCKER_HUB_USERNAME }}/phoenix:${{ needs.release.outputs.version }}