Skip to content

Commit 9d20ba1

Browse files
author
Felix Kleinekathöfer
authored
Updated workflow
1 parent 1c42a3c commit 9d20ba1

File tree

1 file changed

+25
-52
lines changed

1 file changed

+25
-52
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,19 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13-
14-
strategy:
15-
matrix:
16-
node-version: [12.x, 14.x]
17-
python-version: [3.x]
18-
13+
1914
steps:
2015
- uses: actions/checkout@v2
21-
- name: Cache npm dependencies
22-
uses: actions/cache@v2
23-
with:
24-
path: ~/.npm
25-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26-
restore-keys: |
27-
${{ runner.os }}-node-
28-
- name: Cache pip dependencies
29-
uses: actions/cache@v2
30-
with:
31-
path: ~/.cache/pip
32-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
33-
restore-keys: |
34-
${{ runner.os }}-pip-
35-
- name: Setup Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v1
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v2
3718
with:
38-
node-version: ${{ matrix.node-version }}
39-
- name: Setup Python ${{ matrix.python-version }}
19+
node-version: '16.x'
20+
cache: 'npm'
21+
- name: Setup Python
4022
uses: actions/setup-python@v2
4123
with:
42-
python-version: ${{ matrix.python-version }}
24+
python-version: '3.x'
25+
cache: 'pip'
4326
- name: Install NPM dependencies
4427
run: npm ci
4528
- name: Install Python dependencies
@@ -55,28 +38,16 @@ jobs:
5538
if: startsWith(github.ref, 'refs/tags')
5639
steps:
5740
- uses: actions/checkout@v2
58-
- name: Cache npm dependencies
59-
uses: actions/cache@v2
60-
with:
61-
path: ~/.npm
62-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
63-
restore-keys: |
64-
${{ runner.os }}-node-
65-
- name: Cache pip dependencies
66-
uses: actions/cache@v2
67-
with:
68-
path: ~/.cache/pip
69-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
70-
restore-keys: |
71-
${{ runner.os }}-pip-
7241
- name: Setup Node.js
73-
uses: actions/setup-node@v1
42+
uses: actions/setup-node@v2
7443
with:
75-
node-version: 14
76-
- name: Setup Python 3.x
44+
node-version: '16.x'
45+
cache: 'npm'
46+
- name: Setup Python
7747
uses: actions/setup-python@v2
7848
with:
79-
python-version: 3.x
49+
python-version: '3.x'
50+
cache: 'pip'
8051
- name: Install NPM dependencies
8152
run: npm ci
8253
- name: Install Python dependencies
@@ -101,23 +72,25 @@ jobs:
10172
needs: build
10273
if: startsWith(github.ref, 'refs/tags')
10374
steps:
104-
- name: Docker meta
75+
- name: Docker Metadata
10576
id: docker_meta
106-
uses: crazy-max/ghaction-docker-meta@v1
77+
uses: docker/metadata-action@v3
10778
with:
108-
images: docker-registry.spongepowered.org/sponge-docs-theme
109-
tag-match: \d{1,3}.\d{1,3}.\d{1,3}
110-
tag-match-group: 0
79+
images: ghcr.io/spongepowered/sponge-docs-theme
80+
flavor: |
81+
latest=auto
82+
tags: |
83+
type=semver,pattern={{version}}
11184
- name: Set up QEMU
11285
uses: docker/setup-qemu-action@v1
11386
- name: Set up Docker Buildx
11487
uses: docker/setup-buildx-action@v1
115-
- name: Login to DockerHub
88+
- name: Login to ghcr.io
11689
uses: docker/login-action@v1
11790
with:
118-
registry: docker-registry.spongepowered.org
119-
username: ${{ secrets.SPONGE_MAVEN_REPO_USER }}
120-
password: ${{ secrets.SPONGE_MAVEN_REPO_PASSWORD }}
91+
registry: ghcr.io
92+
username: ${{ github.actor }}
93+
password: ${{ secrets.GITHUB_TOKEN }}
12194
- name: Build and push
12295
uses: docker/build-push-action@v2
12396
with:

0 commit comments

Comments
 (0)