Skip to content

Commit f208e04

Browse files
authored
Add docker-push workflow (#62)
1 parent 37c02f3 commit f208e04

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: DockerPush
2+
3+
on:
4+
push:
5+
branches: [ submission ]
6+
pull_request:
7+
branches: [ submission ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: build
15+
run: |
16+
IMAGE_NAME=imos/icfpc2020:$(git rev-parse --short "$GITHUB_SHA")
17+
echo ${{ secrets.DOCKER_PASSWORD }} | \
18+
docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin
19+
docker build \
20+
--tag ${IMAGE_NAME} \
21+
--cache-from=imos/icfpc2020:canndidate \
22+
--cache-from=imos/icfpc2020:submission \
23+
.
24+
docker tag ${IMAGE_NAME} imos/icfpc2020:candidate
25+
docker push ${IMAGE_NAME}
26+
docker push imos/icfpc2020:candidate
27+
- name: push-submission
28+
run: |
29+
docker tag imos/icfpc2020:candidate imos/icfpc2020:submission
30+
docker push imos/icfpc2020:submission
31+
if: ${{ github.event_name == 'push' }}

0 commit comments

Comments
 (0)