asg-server/.github/workflows/docker-publish.yml
2025-09-24 13:47:55 +07:00

54 lines
1.2 KiB
YAML

name: docker-publish
on:
pull_request:
permissions:
contents: read
jobs:
e2e:
name: E2E
runs-on: ubuntu-latest
steps:
# step 1: checkout repository code
- name: Checkout code into workspace directory
uses: actions/checkout@v4
# step 2: set up go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: test/e2e/go.sum
# step 3: start services
- name: Start services
env:
"FCM__CREDENTIALS_JSON": ${{ secrets.FCM__CREDENTIALS_JSON }}
run: docker compose -f test/e2e/docker-compose.yml up -d --build
# step 4: run test
- name: Run e2e tests
run: cd test/e2e && go test -count=1 .
# step 5: stop services
- name: Stop services
run: docker compose -f test/e2e/docker-compose.yml down -v
continue-on-error: true
build:
name: Build
permissions:
contents: read
packages: write
needs:
- e2e
if: github.actor != 'dependabot[bot]'
uses: ./.github/workflows/docker-build.yml
with:
app-name: sms-gateway
secrets:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}