Skip to content

chore(deps): bump github/codeql-action from 1 to 3 #130

chore(deps): bump github/codeql-action from 1 to 3

chore(deps): bump github/codeql-action from 1 to 3 #130

name: Test and Deploy with Docker
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: docker/setup-buildx-action@v1
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-apisixdashboard-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-apisixdashboard-
${{ runner.os }}-buildx-
- name: Build Docker Image
uses: docker/build-push-action@v2
with:
load: true
tags: dashboard:ci
context: .
build-args: |
APISIX_DASHBOARD_VERSION=master
cache-from: |
type=local,src=/tmp/.buildx-cache
cache-to: |
type=local,dest=/tmp/.buildx-cache
- name: Modify Config
run: |
sed -i 's/127.0.0.1:2379/172.16.238.10:2379/' api/conf/conf.yaml
sed -i '[email protected]@0.0.0.0/0@' ./api/conf/conf.yaml
# At present, the docker CI is still running the code of the master branch
# So we need to configure `listen.host` so that it can be accessed outside docker
sed -i '/port: 9000/i\ host: 0.0.0.0' ./api/conf/conf.yaml
- name: build docker images
working-directory: ./api/test/docker-deploy
continue-on-error: true
run: |
docker buildx bake --load \
-f docker-compose.yaml \
--set *.cache-from=type=local,src=/tmp/.buildx-cache \
--set *.cache-to=type=local,dest=/tmp/.buildx-cache
- name: Run Docker Compose
working-directory: ./api/test/docker-deploy
run: |
docker-compose up -d
sleep 5
docker logs docker-deploy_managerapi_1
- name: Run Test
run: api/test/shell/manager_smoking.sh -s false
- uses: Azure/docker-login@v1
if: ${{ github.event_name == 'push' }}
with:
login-server: apisixacr.azurecr.cn
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Deploy
if: ${{ github.event_name == 'push' }}
run: |
docker tag dashboard:ci apisixacr.azurecr.cn/dashboard:${{ github.sha }}
docker push apisixacr.azurecr.cn/dashboard:${{ github.sha }}