Skip to content

Commit 1e0e245

Browse files
authored
Merge pull request #16 from shogo82148/auto-build
add build workflows
2 parents 993e422 + 29975ec commit 1e0e245

File tree

3 files changed

+156
-0
lines changed

3 files changed

+156
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: amazonlinux2-1.0
2+
3+
on:
4+
push:
5+
paths:
6+
- al2/1.0/*/*
7+
- .github/workflows/amazonlinux2-1.0.yml
8+
pull_request:
9+
paths:
10+
- al2/1.0/*/*
11+
- .github/workflows/amazonlinux2-1.0.yml
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
golang:
19+
- "1.11"
20+
- "1.12"
21+
steps:
22+
- uses: actions/checkout@v1
23+
24+
- name: Build the Docker image
25+
run: |
26+
docker build . --tag "$TAG"
27+
working-directory: "al2/1.0/go${{ matrix.golang }}"
28+
env:
29+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-amazonlinux2-1.0"
30+
31+
- name: Publish to the Docker Hub
32+
run: |
33+
printenv PASSWORD | docker login -u "$USERNAME" --password-stdin
34+
docker push "$TAG"
35+
env:
36+
USERNAME: ${{ secrets.username }}
37+
PASSWORD: ${{ secrets.password }}
38+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-amazonlinux2-1.0"
39+
if: github.ref == 'refs/heads/master'
40+
41+
- name: Publish to the GitHub package registry
42+
run: |
43+
printenv PASSWORD | docker login docker.pkg.github.com -u "$USERNAME" --password-stdin
44+
docker tag "$TAG" "$PACKAGE:$(date --date "$DATE" -u +"%Y-%m-%d")"
45+
docker push "$PACKAGE:$(date --date "$DATE" -u +"%Y-%m-%d")"
46+
env:
47+
USERNAME: ${{ github.actor }}
48+
PASSWORD: ${{ secrets.token }}
49+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-amazonlinux2-1.0"
50+
PACKAGE: "docker.pkg.github.com/${{ github.repository }}/go${{ matrix.golang }}-amazonlinux2-1.0"
51+
DATE: ${{ github.event.head_commit.timestamp }}
52+
if: github.ref == 'refs/heads/master'

.github/workflows/standard-1.0.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: standard-1.0
2+
3+
on:
4+
push:
5+
paths:
6+
- ubuntu/1.0/*/*
7+
- .github/workflows/standard-1.0.yml
8+
pull_request:
9+
paths:
10+
- ubuntu/1.0/*/*
11+
- .github/workflows/standard-1.0.yml
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
golang:
19+
- "1.11"
20+
- "1.12"
21+
steps:
22+
- uses: actions/checkout@v1
23+
24+
- name: Build the Docker image
25+
run: |
26+
docker build . --tag "$TAG"
27+
working-directory: "ubuntu/1.0/go${{ matrix.golang }}"
28+
env:
29+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-standard-1.0"
30+
31+
- name: Publish to the Docker Hub
32+
run: |
33+
printenv PASSWORD | docker login -u "$USERNAME" --password-stdin
34+
docker push "$TAG"
35+
env:
36+
USERNAME: ${{ secrets.username }}
37+
PASSWORD: ${{ secrets.password }}
38+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-standard-1.0"
39+
if: github.ref == 'refs/heads/master'
40+
41+
- name: Publish to the GitHub package registry
42+
run: |
43+
printenv PASSWORD | docker login docker.pkg.github.com -u "$USERNAME" --password-stdin
44+
docker tag "$TAG" "$PACKAGE:$(date --date "$DATE" -u +"%Y-%m-%d")"
45+
docker push "$PACKAGE:$(date --date "$DATE" -u +"%Y-%m-%d")"
46+
env:
47+
USERNAME: ${{ github.actor }}
48+
PASSWORD: ${{ secrets.token }}
49+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-standard-1.0"
50+
PACKAGE: "docker.pkg.github.com/${{ github.repository }}/go${{ matrix.golang }}-standard-1.0"
51+
DATE: ${{ github.event.head_commit.timestamp }}
52+
if: github.ref == 'refs/heads/master'

.github/workflows/standard-2.0.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: standard-2.0
2+
3+
on:
4+
push:
5+
paths:
6+
- ubuntu/2.0/*/*
7+
- .github/workflows/standard-2.0.yml
8+
pull_request:
9+
paths:
10+
- ubuntu/2.0/*/*
11+
- .github/workflows/standard-2.0.yml
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
golang:
19+
- "1.11"
20+
- "1.12"
21+
steps:
22+
- uses: actions/checkout@v1
23+
24+
- name: Build the Docker image
25+
run: |
26+
docker build . --tag "$TAG"
27+
working-directory: "ubuntu/2.0/go${{ matrix.golang }}"
28+
env:
29+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-standard-2.0"
30+
31+
- name: Publish to the Docker Hub
32+
run: |
33+
printenv PASSWORD | docker login -u "$USERNAME" --password-stdin
34+
docker push "$TAG"
35+
env:
36+
USERNAME: ${{ secrets.username }}
37+
PASSWORD: ${{ secrets.password }}
38+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-standard-2.0"
39+
if: github.ref == 'refs/heads/master'
40+
41+
- name: Publish to the GitHub package registry
42+
run: |
43+
printenv PASSWORD | docker login docker.pkg.github.com -u "$USERNAME" --password-stdin
44+
docker tag "$TAG" "$PACKAGE:$(date --date "$DATE" -u +"%Y-%m-%d")"
45+
docker push "$PACKAGE:$(date --date "$DATE" -u +"%Y-%m-%d")"
46+
env:
47+
USERNAME: ${{ github.actor }}
48+
PASSWORD: ${{ secrets.token }}
49+
TAG: "${{ secrets.username }}/codebuild-golang:${{ matrix.golang }}-standard-2.0"
50+
PACKAGE: "docker.pkg.github.com/${{ github.repository }}/go${{ matrix.golang }}-standard-2.0"
51+
DATE: ${{ github.event.head_commit.timestamp }}
52+
if: github.ref == 'refs/heads/master'

0 commit comments

Comments
 (0)