-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (34 loc) · 1.05 KB
/
master.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
34
35
name: Master CI/CD
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
cd:
env:
DOCKER_TMP_NAME: mkdocs
runs-on: ubuntu-latest
# needs: ci
steps:
- uses: actions/checkout@v1
- name: Docker login
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build
run: docker build -t $DOCKER_TMP_NAME .
- name: Tags
run: |
docker tag $DOCKER_TMP_NAME ${{ github.repository }}:${{ github.sha }}
docker tag $DOCKER_TMP_NAME ${{ github.repository }}:latest
- name: check install
run: |
docker images
docker run --rm ${{ github.repository }}:${{ github.sha }} mkdocs -V
docker run --rm ${{ github.repository }}:${{ github.sha }} ssh -V
docker run --rm ${{ github.repository }}:${{ github.sha }} bash --version
- name: Push
run: |
docker push ${{ github.repository }}:${{ github.sha }}
docker push ${{ github.repository }}:latest