-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (50 loc) · 2.08 KB
/
porter_images.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
name: Site build
"on":
push:
paths:
- site/**
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_IMAGES}}" | xargs)
DOCKER_BUILDKIT=1 sudo docker buildx build -f site/Dockerfile \
--build-arg NEXT_PUBLIC_TYPESENSE_KEY=myeOtddZLPNZlfP5RGXwf2KzMnTBgeJZ \
--build-arg NEXT_PUBLIC_TYPESENSE_URL=https://search.kiyomi.io \
--build-arg NEXT_PUBLIC_BASE_URL=https://kiyomi.io \
--build-arg NEXT_PUBLIC_GAME_URL=wss://dubu.kiyomi.io \
--build-arg NEXT_PUBLIC_BASE_URL_CDN=https://img.kiyomi.io \
. -t index.docker.io/xetera/simp-pics:$(git rev-parse --short HEAD)
sudo docker push index.docker.io/xetera/simp-pics:$(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_IMAGES}}?commit=$(git rev-parse --short HEAD)&repository=index.docker.io/xetera/simp-pics"
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: 'Deploying new site version!'