-
-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (86 loc) · 2.57 KB
/
develop.yml
File metadata and controls
89 lines (86 loc) · 2.57 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
85
86
87
88
89
name: Agregarr Develop
on:
pull_request:
branches:
- '*'
push:
branches:
- develop
- 'feature/**'
paths-ignore:
- '**.md'
- 'docs/**'
- '.gitignore'
- 'LICENSE'
jobs:
test:
name: Lint & Test Build
if: github.event_name == 'pull_request'
runs-on: ubuntu-22.04
container: node:20.19.5-alpine
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: |
apk add --no-cache \
python3 make g++ gcc libc6-compat bash \
build-base cairo-dev pango-dev jpeg-dev giflib-dev pixman-dev
- name: Install dependencies
env:
HUSKY: 0
run: yarn
- name: Lint
run: yarn lint
- name: Type Check
run: yarn typecheck
- name: Formatting
run: npx prettier --check .
- name: Build
run: yarn build
build_and_push:
name: Build & Publish Docker Images
if: github.event_name == 'push'
runs-on: ubuntu-22.04
steps:
- name: Free disk space
run: |
echo "Before cleanup:"
df -h /
sudo rm -rf /usr/share/dotnet /opt/ghcrunner /usr/local/lib/android /usr/share/swift
echo "After cleanup:"
df -h /
- name: Checkout
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Determine Docker tags and platforms
id: tags
run: |
BRANCH="${GITHUB_REF#refs/heads/}"
if [ "$BRANCH" = "develop" ]; then
echo "tags=bitr8/agregarr:develop,bitr8/agregarr:latest" >> "$GITHUB_OUTPUT"
echo "platforms=linux/amd64,linux/arm64" >> "$GITHUB_OUTPUT"
else
# feature/collection-sync-dashboard → collection-sync-dashboard
SLUG="${BRANCH#feature/}"
echo "tags=bitr8/agregarr:${SLUG}" >> "$GITHUB_OUTPUT"
echo "platforms=linux/amd64" >> "$GITHUB_OUTPUT"
fi
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: ${{ steps.tags.outputs.platforms }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT_TAG=${{ github.sha }}
tags: ${{ steps.tags.outputs.tags }}