fix: update python deps #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Semver, Build, Publish | |
on: | |
push: | |
branches: [main, alpha, beta] | |
jobs: | |
semver: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Semantic Release - prepare | |
run: | | |
cat <<EOF > package.json | |
{ | |
"name": "semver", | |
"private": true | |
} | |
EOF | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v3 | |
with: | |
semantic_version: 16 | |
branches: | | |
[ | |
'main', | |
{ | |
name: 'alpha', | |
prerelease: true | |
}, | |
{ | |
name: 'beta', | |
prerelease: true | |
} | |
] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
id: semantic | |
outputs: | |
version: ${{ steps.semantic.outputs.new_release_version }} | |
new_release_published: ${{ steps.semantic.outputs.new_release_published }} | |
new_release_channel: ${{ steps.semantic.outputs.new_release_channel }} | |
build_and_publish: | |
runs-on: ubuntu-latest | |
needs: [semver] | |
if: needs.semver.outputs.new_release_published == 'true' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build app | |
run: docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ needs.semver.outputs.version }} | |
- name: Build Static | |
run: docker build . --target static -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}-static:${{ needs.semver.outputs.version }} | |
- name: Tag using channel | |
run: | | |
CHANNEL=${{ needs.semver.outputs.new_release_channel }} | |
docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${CHANNEL:-'latest'} | |
docker build . --target static -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}-static:${CHANNEL:-'latest'} | |
- name: Login to Docker Hub | |
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | |
- name: Push image | |
run: | | |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ needs.semver.outputs.version }} | |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}-static:${{ needs.semver.outputs.version }} | |
- name: Push image on channel tag | |
run: | | |
CHANNEL=${{ needs.semver.outputs.new_release_channel }} | |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${CHANNEL:-'latest'} | |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}-static:${CHANNEL:-'latest'} | |
- name: Docker Hub Description | |
uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
repository: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} |