fix: free occupancies for cancellation pendig bookings #1105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Continous Integration - CI | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: buildx | |
uses: docker/setup-buildx-action@master | |
- name: prepare artifacts | |
run: mkdir -p artifacts | |
- name: docker login | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: docker build test | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
load: true | |
push: false | |
target: test | |
tags: ghcr.io/${{ github.repository }}-test:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: docker build target | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
load: true | |
push: false | |
target: production | |
tags: ghcr.io/${{ github.repository }}:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
# build-args: | |
# FOOTER_VERSION: "${{ github.ref_name }}" | |
- name: migrate | |
run: docker-compose --file docker-compose.ci.yml run e2e_target bin/rails db:drop db:create db:migrate | |
- name: migrate | |
run: docker-compose --file docker-compose.ci.yml up -d e2e_target | |
- name: bin/check | |
run: docker-compose --file docker-compose.ci.yml run e2e_test bin/check | |
- if: github.event_name != 'pull_request' | |
name: docker tag | |
run: docker tag ghcr.io/${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
- if: github.event_name != 'pull_request' | |
name: docker push | |
run: docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
# uses: docker/build-push-action@v3 | |
# with: | |
# push: true | |
# tags: "ghcr.io/${{ github.repository }}:${{ github.ref_name }}" | |
# cache-from: type=gha | |
# cache-to: type=gha,mode=max | |
- if: failure() | |
name: dump log | |
run: docker compose --file docker-compose.ci.yml logs > ./artifacts/docker-compose.ci.log | |
- if: failure() | |
name: dump tmp | |
run: docker compose --file docker-compose.ci.yml cp e2e_test:/rails/tmp ./artifacts/tmp | |
- if: failure() | |
name: upload artifacts | |
uses: actions/upload-artifact@master | |
with: | |
name: artifacts | |
path: artifacts |