v2.0.0-beta.3 #8
Workflow file for this run
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: Rust CI/CD | |
on: | |
release: | |
types: [ published ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Get version from github ref | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
tags: r2mhub/joel-bot:${{ steps.get_version.outputs.VERSION }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_push | |
steps: | |
- name: Get version from github ref | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
- name: Login via Azure CLI | |
uses: azure/login@v2 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Deploy joel-bot | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: joel-bot | |
images: r2mhub/joel-bot:${{ steps.get_version.outputs.VERSION }} | |
- name: Azure logout | |
run: | | |
az logout |