Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

Commit 73cef95

Browse files
committed
add actions from upstream
1 parent 2cc0cd7 commit 73cef95

File tree

4 files changed

+214
-0
lines changed

4 files changed

+214
-0
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
ruby-version: [2.6, 2.7, '3.0', 3.1, 3.2]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: ${{ matrix.ruby-version }}
23+
24+
- uses: actions/cache@v3
25+
with:
26+
path: vendor/bundle
27+
key: gems-${{ runner.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
28+
restore-keys: |
29+
gems-${{ runner.os }}-${{ matrix.ruby-version }}-
30+
gems-${{ runner.os }}-
31+
32+
- run: bundle config set deployment 'true'
33+
- name: bundle install
34+
run: |
35+
bundle config path vendor/bundle
36+
bundle install --jobs 4 --retry 3
37+
38+
- run: bundle exec middleman build

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: [ 'main' ]
6+
7+
jobs:
8+
deploy:
9+
permissions:
10+
contents: write
11+
12+
runs-on: ubuntu-latest
13+
env:
14+
ruby-version: 2.6
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Ruby
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: ${{ env.ruby-version }}
22+
23+
- uses: actions/cache@v3
24+
with:
25+
path: vendor/bundle
26+
key: gems-${{ runner.os }}-${{ env.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
27+
restore-keys: |
28+
gems-${{ runner.os }}-${{ env.ruby-version }}-
29+
gems-${{ runner.os }}-
30+
31+
- run: bundle config set deployment 'true'
32+
- name: bundle install
33+
run: |
34+
bundle config path vendor/bundle
35+
bundle install --jobs 4 --retry 3
36+
37+
- run: bundle exec middleman build
38+
39+
- name: Deploy
40+
uses: peaceiris/actions-gh-pages@v3
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
publish_dir: ./build
44+
keep_files: true

.github/workflows/dev_deploy.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Dev Deploy
2+
3+
on:
4+
push:
5+
branches: [ 'dev' ]
6+
7+
jobs:
8+
push_to_registry:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v3
14+
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v1
17+
with:
18+
platforms: all
19+
20+
- name: Docker meta
21+
id: meta
22+
uses: docker/metadata-action@v3
23+
with:
24+
images: |
25+
slatedocs/slate
26+
tags: |
27+
type=ref,event=branch
28+
29+
- name: Set up Docker Buildx
30+
id: buildx
31+
uses: docker/setup-buildx-action@v1
32+
33+
- name: Login to DockerHub
34+
uses: docker/login-action@v1
35+
with:
36+
username: ${{ secrets.DOCKER_USERNAME }}
37+
password: ${{ secrets.DOCKER_ACCESS_KEY }}
38+
39+
- name: Push to Docker Hub
40+
uses: docker/build-push-action@v2
41+
with:
42+
builder: ${{ steps.buildx.outputs.name }}
43+
context: .
44+
file: ./Dockerfile
45+
platforms: linux/amd64,linux/arm64,linux/ppc64le
46+
push: true
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}
49+
50+
deploy_gh:
51+
permissions:
52+
contents: write
53+
54+
runs-on: ubuntu-latest
55+
env:
56+
ruby-version: 2.6
57+
58+
steps:
59+
- uses: actions/checkout@v3
60+
- name: Set up Ruby
61+
uses: ruby/setup-ruby@v1
62+
with:
63+
ruby-version: ${{ env.ruby-version }}
64+
65+
- uses: actions/cache@v3
66+
with:
67+
path: vendor/bundle
68+
key: gems-${{ runner.os }}-${{ env.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
69+
restore-keys: |
70+
gems-${{ runner.os }}-${{ env.ruby-version }}-
71+
gems-${{ runner.os }}-
72+
- run: bundle config set deployment 'true'
73+
- name: bundle install
74+
run: |
75+
bundle config path vendor/bundle
76+
bundle install --jobs 4 --retry 3
77+
- run: bundle exec middleman build
78+
79+
- name: Deploy
80+
uses: peaceiris/[email protected]
81+
with:
82+
github_token: ${{ secrets.GITHUB_TOKEN }}
83+
destination_dir: dev
84+
publish_dir: ./build
85+
keep_files: true

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Docker image
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
push_to_registry:
9+
name: Push Docker image to Docker Hub
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v3
14+
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v1
17+
with:
18+
platforms: all
19+
20+
- name: Docker meta
21+
id: meta
22+
uses: docker/metadata-action@v3
23+
with:
24+
images: slatedocs/slate
25+
tags: |
26+
type=ref,event=tag
27+
28+
- name: Set up Docker Buildx
29+
id: buildx
30+
uses: docker/setup-buildx-action@v1
31+
32+
- name: Login to DockerHub
33+
uses: docker/login-action@v1
34+
with:
35+
username: ${{ secrets.DOCKER_USERNAME }}
36+
password: ${{ secrets.DOCKER_ACCESS_KEY }}
37+
38+
- name: Push to Docker Hub
39+
uses: docker/build-push-action@v2
40+
with:
41+
builder: ${{ steps.buildx.outputs.name }}
42+
context: .
43+
file: ./Dockerfile
44+
platforms: linux/amd64,linux/arm64,linux/ppc64le
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)