-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (46 loc) · 1.29 KB
/
rust_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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