-
Notifications
You must be signed in to change notification settings - Fork 5
42 lines (38 loc) · 1.51 KB
/
porter_labeler.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
name: Labeler build
"on":
push:
paths:
- labeler/**
branches:
- main
jobs:
porter-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2.3.4
- name: Download Porter
id: download_porter
run: |2
name=$(curl -s https://api.github.com/repos/porter-dev/porter/releases/latest | grep "browser_download_url.*/porter_.*_Linux_x86_64\.zip" | cut -d ":" -f 2,3 | tr -d \")
name=$(basename $name)
curl -L https://github.com/porter-dev/porter/releases/latest/download/$name --output $name
unzip -a $name
rm $name
chmod +x ./porter
sudo mv ./porter /usr/local/bin/porter
- name: Configure Porter
id: configure_porter
run: |2
sudo porter auth login --token ${{secrets.PORTER_TOKEN_662}}
sudo porter docker configure
- name: Docker build, push
id: docker_build_push
run: |2
export $(echo "${{secrets.ENV_LABELER}}" | xargs)
cd labeler && sudo docker buildx build -t index.docker.io/xetera/simp-pics-labeler:$(git rev-parse --short HEAD) .
sudo docker push index.docker.io/xetera/simp-pics-labeler:$(git rev-parse --short HEAD)
- name: Deploy on Porter
id: deploy_porter
run: |2
curl -X POST "https://dashboard.getporter.dev/api/webhooks/deploy/${{secrets.WEBHOOK_LABELER}}?commit=$(git rev-parse --short HEAD)&repository=index.docker.io/xetera/simp-pics-labeler"