Skip to content

Commit 649aa52

Browse files
authored
Merge pull request #8 from matsuu/github-actions
Add github workflow
2 parents 82ee91f + 7b6f26b commit 649aa52

File tree

2 files changed

+60
-10
lines changed

2 files changed

+60
-10
lines changed

.github/workflows/docker.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
docker:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: docker/setup-qemu-action@v2
11+
- uses: docker/setup-buildx-action@v2
12+
- uses: docker/login-action@v2
13+
if: github.ref_type == 'tag'
14+
with:
15+
username: ${{ secrets.DOCKERHUB_USERNAME }}
16+
password: ${{ secrets.DOCKERHUB_TOKEN }}
17+
- uses: docker/login-action@v2
18+
if: github.ref_type == 'tag'
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.repository_owner }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
- uses: docker/metadata-action@v4
24+
id: meta
25+
with:
26+
images: |
27+
${{ github.repository_owner }}/nethack
28+
ghcr.io/${{ github.repository_owner }}/nethack
29+
flavor: |
30+
latest=true
31+
tags: |
32+
type=semver,pattern={{version}}
33+
- uses: docker/build-push-action@v3
34+
with:
35+
context: .
36+
platforms: linux/amd64,linux/arm64
37+
push: ${{ github.ref_type == 'tag' }}
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}
40+
cache-from: type=gha,scope=nethack
41+
cache-to: type=gha,mode=max,scope=nethack
42+
- uses: docker/metadata-action@v4
43+
id: meta_x11
44+
with:
45+
images: |
46+
${{ github.repository_owner }}/nethack-x11
47+
ghcr.io/${{ github.repository_owner }}/nethack-x11
48+
flavor: |
49+
latest=true
50+
tags: |
51+
type=semver,pattern={{version}}
52+
- uses: docker/build-push-action@v3
53+
with:
54+
context: x11
55+
platforms: linux/amd64,linux/arm64
56+
push: ${{ github.ref_type == 'tag' }}
57+
tags: ${{ steps.meta_x11.outputs.tags }}
58+
labels: ${{ steps.meta_x11.outputs.labels }}
59+
cache-from: type=gha,scope=x11
60+
cache-to: type=gha,mode=max,scope=x11

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)