-
Notifications
You must be signed in to change notification settings - Fork 6
33 lines (29 loc) · 881 Bytes
/
docker.yml
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
29
30
31
32
33
name: Docker
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Compute image tag name
run: echo "IMAGE_TAG=$(date -u '+%Y%m%d-%H%M%S')" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
registry: registry.hub.docker.com
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: true
build-args: |
GITHUB_SHA=${{ github.sha }}
tags: |
registry.hub.docker.com/wuhan005/elaina:${{ env.IMAGE_TAG }}
registry.hub.docker.com/wuhan005/elaina:latest