MilesCranmer commited on
Commit
5ab3eb4
1 Parent(s): 3d686b6

Create dockerhub deploy action

Browse files
Files changed (1) hide show
  1. .github/workflows/docker_deploy.yml +56 -0
.github/workflows/docker_deploy.yml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy Docker
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 10 * * *"
6
+ push:
7
+ branches:
8
+ - "**"
9
+ tags:
10
+ - "v*.*.*"
11
+ pull_request:
12
+ branches:
13
+ - 'master'
14
+ workflow_dispatch:
15
+
16
+
17
+ jobs:
18
+ docker:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v3
23
+ - name: Docker meta
24
+ id: meta
25
+ uses: docker/metadata-action@v4
26
+ with:
27
+ # list of Docker images to use as base name for tags
28
+ images: |
29
+ mcranmer/pysr
30
+ # generate Docker tags based on the following events/attributes
31
+ tags: |
32
+ type=schedule
33
+ type=ref,event=branch
34
+ type=ref,event=pr
35
+ type=semver,pattern={{version}}
36
+ type=semver,pattern={{major}}.{{minor}}
37
+ type=semver,pattern={{major}}
38
+ type=sha
39
+ - name: Set up QEMU
40
+ uses: docker/setup-qemu-action@v2
41
+ - name: Set up Docker Buildx
42
+ uses: docker/setup-buildx-action@v2
43
+ - name: Login to Docker Hub
44
+ uses: docker/login-action@v2
45
+ if: github.event_name != 'pull_request'
46
+ with:
47
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
48
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
49
+ - name: Build and push
50
+ uses: docker/build-push-action@v3
51
+ with:
52
+ context: .
53
+ platforms: linux/amd64,linux/arm64
54
+ push: ${{ github.event_name != 'pull_request' }}
55
+ tags: ${{ steps.meta.outputs.tags }}
56
+ labels: ${{ steps.meta.outputs.labels }}