diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45ecbac..02a9611 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: Build -on: [push, pull_request, workflow_dispatch] +on: [pull_request] jobs: build: @@ -11,14 +11,9 @@ jobs: submodules: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - # - - # name: Login to Docker Hub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push + - name: Build uses: docker/build-push-action@v5 with: + cache-to: type=gha,mode=max + cache-from: type=gha push: false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..52a1ddb --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Deploy + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build + uses: docker/build-push-action@v5 + with: + cache-to: type=gha,mode=max + cache-from: type=gha + push: false + tags: churchroad-web-demo + + - name: Start container and copy www/ directory + run: | + docker run -d --name churchroad-web-demo churchroad-web-demo + docker cp churchroad-web-demo:/root/target/www out/ + docker rm -f churchroad-web-demo + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} +