diff --git a/.github/workflows/kamal-deploy.yml b/.github/workflows/kamal-deploy-api.yml similarity index 95% rename from .github/workflows/kamal-deploy.yml rename to .github/workflows/kamal-deploy-api.yml index 8ce0cc5c..75581101 100644 --- a/.github/workflows/kamal-deploy.yml +++ b/.github/workflows/kamal-deploy-api.yml @@ -1,4 +1,4 @@ -name: Deploy +name: Deploy API concurrency: group: production cancel-in-progress: true @@ -13,7 +13,7 @@ on: options: - staging - prod -run-name: Deploy to ${{ inputs.env }} +run-name: Deploy API to ${{ inputs.env }} jobs: deploy: @@ -52,7 +52,7 @@ jobs: - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - uses: crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3.1.0 - - name: Deploy + - name: Deploy API run: | echo "------------------------" echo "Deliver image to env (ignored) ${{ github.event.inputs.env }}" diff --git a/.github/workflows/kamal-deploy-webapp.yml b/.github/workflows/kamal-deploy-webapp.yml new file mode 100644 index 00000000..b99ec8ab --- /dev/null +++ b/.github/workflows/kamal-deploy-webapp.yml @@ -0,0 +1,63 @@ +name: Deploy Webapp +concurrency: + group: production + cancel-in-progress: true +on: + workflow_dispatch: + inputs: + env: + description: "Environment to deploy to" + required: true + default: "staging" + type: choice + options: + - staging + - prod +run-name: Deploy Webapp to ${{ inputs.env }} + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + env: + DOCKER_BUILDKIT: 1 + KAMAL_REGISTRY_USERNAME: ${{ secrets.KAMAL_REGISTRY_USERNAME }} + KAMAL_REGISTRY_PASSWORD: ${{ secrets.KAMAL_REGISTRY_PASSWORD }} + HOST_IP: ${{ secrets.HOST_IP }} + steps: + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + + - name: Install Kamal + uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0 + with: + ruby-version: 3.4.1 + bundler-cache: true + - run: gem install kamal + + - uses: webfactory/ssh-agent@a6f90b1f127823b31d4d4a8d96047790581349bd # v0.9.1 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Log in to the ghcr.io + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 + - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + - uses: crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3.1.0 + + - name: Deploy Webapp + working-directory: ./webapp + run: | + echo "------------------------" + echo "Deliver image to env (ignored) ${{ github.event.inputs.env }}" + echo "------------------------" + kamal deploy + echo "------------------------" + kamal details diff --git a/webapp/config/deploy.yml b/webapp/config/deploy.yml index 158fb548..152267be 100644 --- a/webapp/config/deploy.yml +++ b/webapp/config/deploy.yml @@ -32,15 +32,3 @@ env: ssh: user: player - -accessories: - arcadedb: - image: arcadedata/arcadedb-headless:25.4.1 - host: <%= ENV["HOST_IP"] %> - volumes: - - /home/player/linklift/config:/home/arcadedb/config - - /home/player/linklift/databases:/home/arcadedb/databases - - /home/player/linklift/log:/home/arcadedb/log - env: - clear: - JAVA_OPTS: "-Darcadedb.server.plugins=Postgres:com.arcadedb.postgres.PostgresProtocolPlugin"