forked from Corsace/corsace
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (106 loc) · 3.34 KB
/
pack.yml
File metadata and controls
114 lines (106 loc) · 3.34 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Lint, build and publish
on:
push:
branches:
- '**'
- '!crowdin'
tags:
- '*'
pull_request_target:
branches:
- '*'
jobs:
lint:
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install Node Dependencies
run: |
npm install
- name: Run linters
uses: wearerequired/lint-action@v2
with:
eslint: true
eslint_extensions: ts,vue
eslint_args: --ignore-path .gitignore
push_to_registry:
runs-on: ubuntu-latest
needs: lint
outputs:
tags: ${{ steps.save_tags.outputs.tags }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
vncommunityleague/vnoc
# generate Docker tags based on the following events/attributes
# on push event: tag using git sha, branch name and as latest (if master)
tags: |
type=raw,value=latest,enable=${{ github.ref_type == 'branch' && github.ref_name == 'master' }}
type=raw,value=${{ github.ref_name }}
type=raw,value=${{ github.sha }},enable=${{ github.ref_type == 'branch' }}
flavor: |
latest=false
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: ${{ github.repository == 'vncommunityleague/vnoc' && github.event_name != 'pull_request_target' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-
name: Save tags
id: save_tags
run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | cut -d ':' -f 2- | jq -Rsc '. / "\n" - [""]')" >> $GITHUB_OUTPUT
# push_chart:
# if: ${{ github.repository == 'vncommunityleague/vnoc' && github.event_name != 'pull_request_target' }}
# runs-on: ubuntu-latest
# needs: push_to_registry
# strategy:
# matrix:
# tag: ${{ fromJSON(needs.push_to_registry.outputs.tags) }}
# exclude:
# - tag: latest
# steps:
# -
# name: Checkout
# uses: actions/checkout@v2
# -
# name: "Helm: Package Chart"
# run: helm package charts/vnoc --version "0.0.0-${{ matrix.tag }}" --app-version "${{ matrix.tag }}"
# -
# name: "Helm: Login to Registry"
# run: echo '${{ secrets.GITHUB_TOKEN }}' | helm registry login -u '${{ github.actor }}' --password-stdin ghcr.io
# -
# name: "Helm: Push Chart"
# run: helm push vnoc-0.0.0-${{ matrix.tag }}.tgz oci://ghcr.io/vnoc/charts
# -
# name: "Helm: Logout"
# run: helm registry logout ghcr.io