CI/CD
This commit is contained in:
parent
154e11e768
commit
85b7cf95f9
2 changed files with 53 additions and 30 deletions
53
.forgejo/workflows/ci_cd.yml
Normal file
53
.forgejo/workflows/ci_cd.yml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
on: [push]
|
||||
env:
|
||||
SELENIUM_REMOTE_URL: http://chrome:4444/wd/hub
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
name: Text
|
||||
container: code.hohl.cloud/jwa11y/a11yist:ci
|
||||
services:
|
||||
chrome:
|
||||
image: selenium/standalone-chrome
|
||||
steps:
|
||||
- name: Cache repository
|
||||
uses: actions/cache@v4
|
||||
id: cache-repository
|
||||
with:
|
||||
path: .
|
||||
key: ${{ runner.os }}-repository-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-repository-
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: .
|
||||
submodules: recursive
|
||||
- run: bundle install
|
||||
- run: mv /app/node_modules .
|
||||
- run: pwd && ls -la && ls -la /app
|
||||
- run: bundle exec rails test
|
||||
- run: bundle exec rails test:system
|
||||
|
||||
continous-delivery:
|
||||
needs: test
|
||||
runs-on: sh
|
||||
name: Build, push and deploy image
|
||||
steps:
|
||||
- name: Cache repository
|
||||
uses: actions/cache@v4
|
||||
id: cache-repository
|
||||
with:
|
||||
path: repository
|
||||
key: ${{ runner.os }}-repository-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-repository-
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: repository
|
||||
submodules: recursive
|
||||
- run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} code.hohl.cloud
|
||||
- run: docker build -t code.hohl.cloud/jwa11y/a11yist:latest --target production repository/
|
||||
- run: docker compose -f /services/a11yist/docker-compose.yml up -d
|
||||
- run: docker push code.hohl.cloud/jwa11y/a11yist:latest
|
||||
Loading…
Add table
Add a link
Reference in a new issue