This commit is contained in:
parent
1403a756f7
commit
ba9bf88a1c
2 changed files with 49 additions and 45 deletions
41
.github/workflows/deploy.yml
vendored
41
.github/workflows/deploy.yml
vendored
|
@ -1,16 +1,35 @@
|
||||||
name: Fly Deploy
|
name: Docker Deploy
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [main]
|
||||||
- main
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build-and-push:
|
||||||
name: Deploy app
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
concurrency: deploy-group # optional: ensure only one action runs at a time
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
- uses: superfly/flyctl-actions/setup-flyctl@master
|
uses: actions/checkout@v3
|
||||||
- run: flyctl deploy --remote-only
|
|
||||||
env:
|
- name: Set up Docker Buildx
|
||||||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.REPO_HOST }}
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||||
|
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||||
|
|
|
@ -1,35 +1,20 @@
|
||||||
name: Docker Deploy
|
services:
|
||||||
on:
|
himbot:
|
||||||
push:
|
build: .
|
||||||
branches: [main]
|
container_name: himbot
|
||||||
pull_request:
|
ports:
|
||||||
branches: [main]
|
- "3000:3000"
|
||||||
jobs:
|
environment:
|
||||||
build-and-push:
|
- DISCORD_TOKEN=${DISCORD_TOKEN}
|
||||||
runs-on: ubuntu-latest
|
- DATABASE_URL=${DATABASE_URL}
|
||||||
permissions:
|
- DATABASE_AUTH_TOKEN=${DATABASE_AUTH_TOKEN}
|
||||||
contents: read
|
volumes:
|
||||||
packages: write
|
- ${ROOT_DIR}/himbot_data:/data
|
||||||
steps:
|
depends_on:
|
||||||
- name: Checkout code
|
- db
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
db:
|
||||||
uses: docker/setup-buildx-action@v2
|
image: nouchka/sqlite3
|
||||||
|
container_name: himbot_db
|
||||||
- name: Login to Container Registry
|
volumes:
|
||||||
uses: docker/login-action@v2
|
- ${ROOT_DIR}/himbot_data:/data
|
||||||
with:
|
|
||||||
registry: ${{ secrets.REPO_HOST }}
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.DEPLOY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
|
||||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue