-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.08 KB
/
rust.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
name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGE: backup_db
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Load secret
id: op-load-secret
uses: 1password/load-secrets-action@v2
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
AZURE_KEY_VAULT_TEST: op://Test/AzureKeyVaultDemo/url
- uses: actions/checkout@v4
- name: Run tests
env:
GITHUB_ACTIONS: true
run: |
cargo test --verbose
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.USERNAME }}
password: ${{ env.TOKEN }}
- name: Build the Docker image
run: |
docker build -t ${{ env.IMAGE }} .
docker tag ${{ env.IMAGE }} ${{ env.USERNAME }}/${{ env.IMAGE }}:latest
docker push ${{ env.USERNAME }}/${{ env.IMAGE }}:latest