Skip to content

Commit

Permalink
CI: Tag with version on release, build-push-action upgrade (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 authored Sep 27, 2021
1 parent ac1ce7e commit d741151
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Build and push the image
uses: docker/build-push-action@v1.1.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: ./Dockerfile
repository: certpl/${{ github.event.repository.name }}
tags: ${{ github.sha }}
- name: Build and push the image
uses: docker/build-push-action@v2.2.1
with:
tags: |
certpl/${{ github.event.repository.name }}:${{ github.sha }}
push: ${{ github.event_name == 'push' }}
28 changes: 25 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Release a new version

on:
push:
tags: 'v*.*.*'
release:
types: [published]

jobs:
release:
release_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -18,3 +18,25 @@ jobs:
with:
user: __token__
password: ${{ secrets.pypi_password }}
release_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push the image
uses: docker/build-push-action@v2.2.1
with:
tags: |
certpl/${{ github.event.repository.name }}:${{ github.sha }}
certpl/${{ github.event.repository.name }}:${{ github.event.release.tag_name }}
certpl/${{ github.event.repository.name }}:latest
push: true

0 comments on commit d741151

Please sign in to comment.