-
Notifications
You must be signed in to change notification settings - Fork 83
43 lines (41 loc) · 1.29 KB
/
build-publish-latest.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
name: Build Latest Image
on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- "docs/**"
workflow_dispatch:
jobs:
publish-latest-docker-image:
runs-on: ubuntu-latest
name: Build and publish docker image
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: |
cd web
npm install
- name: Build web
run: |
cd web
npm run build
# - name: Build image
# run: |
# docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/free-one-api:latest .
# - name: Publish image
# run: |
# docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
# docker push ${{ secrets.DOCKER_HUB_USERNAME }}/free-one-api:latest
- name: Login to Registry
run: docker login --username=${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Create Buildx
run: docker buildx create --name mybuilder --use
- name: Build # image name
run: docker buildx build --platform linux/arm64,linux/amd64 -t rockchin/free-one-api:latest . --push