-
Notifications
You must be signed in to change notification settings - Fork 13
28 lines (26 loc) · 783 Bytes
/
docker.yml
File metadata and controls
28 lines (26 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: build
on:
push:
branches: master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: login to docker hub
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login -u "${{ secrets.DOCKER_USER }}" --password-stdin
- name: get date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: build the image
run: |
docker buildx build --push \
--tag $GITHUB_REPOSITORY:latest \
--tag $GITHUB_REPOSITORY:${{steps.date.outputs.date}} \
--platform linux/amd64 .