|
1 | 1 | on: |
2 | 2 | push: |
3 | 3 | tags: |
4 | | - - '*' |
| 4 | + - "[0-9]*.[0-9]*.[0-9]*" |
5 | 5 |
|
6 | 6 | jobs: |
7 | 7 | docker: |
8 | | - runs-on: ubuntu-latest |
| 8 | + runs-on: ubuntu-22.04 |
9 | 9 | steps: |
10 | | - - uses: "actions/checkout@v2" |
| 10 | + - uses: "actions/checkout@v6" |
11 | 11 |
|
12 | 12 | - name: Set up QEMU |
13 | | - uses: docker/setup-qemu-action@v1 |
| 13 | + uses: docker/setup-qemu-action@v3 |
14 | 14 |
|
15 | 15 | - name: Set up Docker Buildx |
16 | | - uses: docker/setup-buildx-action@v1 |
17 | | - |
18 | | - - name: Get the version |
19 | | - id: version |
20 | | - run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} |
| 16 | + uses: docker/setup-buildx-action@v3 |
21 | 17 |
|
22 | 18 | - name: Update version from tag |
23 | | - env: |
24 | | - VERSION: ${{ steps.version.outputs.VERSION }} |
25 | 19 | run: | |
| 20 | + VERSION="${GITHUB_REF_NAME}" |
26 | 21 | echo "Version is: ${VERSION}" |
27 | | - test -n "${VERSION}" |
| 22 | + [[ "${VERSION}" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]] |
28 | 23 | echo "__version__ = \"${VERSION}\"" > pythonhere/version_here.py |
29 | 24 |
|
30 | 25 | - name: Login to DockerHub |
31 | | - uses: docker/login-action@v1 |
| 26 | + uses: docker/login-action@v3 |
32 | 27 | with: |
33 | 28 | username: ${{ secrets.DOCKER_USERNAME }} |
34 | 29 | password: ${{ secrets.DOCKER_TOKEN }} |
35 | 30 |
|
36 | 31 | - name: Build and push |
37 | 32 | id: docker_build |
38 | | - uses: docker/build-push-action@v2 |
| 33 | + uses: docker/build-push-action@v6 |
39 | 34 | with: |
40 | 35 | context: . |
41 | 36 | file: ./Dockerfile |
42 | 37 | push: true |
43 | 38 | tags: | |
44 | | - "herethere/pythonhere:latest" |
45 | | - "herethere/pythonhere:${{ steps.version.outputs.VERSION }}" |
| 39 | + herethere/pythonhere:latest |
| 40 | + herethere/pythonhere:${{ github.ref_name }} |
46 | 41 |
|
47 | 42 | - name: Image digest |
48 | 43 | run: echo ${{ steps.docker_build.outputs.digest }} |
0 commit comments