Skip to content

Commit 08d2efc

Browse files
authored
Merge pull request #598 from liangliangyy/master
sync
2 parents 93ac23d + c8e9d2f commit 08d2efc

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

.github/workflows/docker.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,27 @@ on:
77
- '**/*.yml'
88
branches:
99
- 'master'
10+
- 'dev'
1011

1112
jobs:
1213
docker:
1314
runs-on: ubuntu-latest
1415
steps:
16+
- name: Set env to staging
17+
if: endsWith(github.ref, '/dev')
18+
run: |
19+
echo "DOCKER_TAG=test" >> $GITHUB_ENV
20+
- name: Set env to production
21+
if: endsWith(github.ref, '/master')
22+
run: |
23+
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
1524
- name: Checkout
1625
uses: actions/checkout@v2
1726
- name: Set up QEMU
1827
uses: docker/setup-qemu-action@v1
1928
- name: Set up Docker Buildx
2029
uses: docker/setup-buildx-action@v1
21-
- name: Cache Docker layers
22-
uses: actions/cache@v2
23-
with:
24-
path: /tmp/.buildx-cache
25-
key: ${{ runner.os }}-buildx-${{ github.sha }}
26-
restore-keys: |
27-
${{ runner.os }}-buildx-
30+
2831
- name: Login to DockerHub
2932
uses: docker/login-action@v1
3033
with:
@@ -35,12 +38,6 @@ jobs:
3538
with:
3639
context: .
3740
push: true
38-
tags: ${{ secrets.DOCKERHUB_USERNAME }}/djangoblog:latest
39-
cache-from: type=local,src=/tmp/.buildx-cache
40-
cache-to: type=local,dest=/tmp/.buildx-cache-new
41-
- name: Move cache
42-
run: |
43-
rm -rf /tmp/.buildx-cache
44-
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
41+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/djangoblog:${{DOCKER_TAG}}
4542

4643

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
coverage==6.4
22
bleach==5.0.0
3-
Django==4.0.6
3+
Django==4.0.7
44
django-compressor==4.0
55
django-haystack==3.2.1
66
django-ipware==4.0.2

0 commit comments

Comments
 (0)