a11yist/.forgejo/workflows/ci_cd.yml

79 lines
2.2 KiB
YAML
Raw Normal View History

2024-07-23 20:35:29 +02:00
on: [push]
2024-07-23 20:40:31 +02:00
2024-07-23 20:35:29 +02:00
env:
SELENIUM_REMOTE_URL: http://chrome:4444/wd/hub
2024-07-23 20:40:31 +02:00
2024-07-23 20:35:29 +02:00
jobs:
test:
runs-on: docker
2024-07-23 20:40:31 +02:00
name: Run tests
2024-07-23 20:35:29 +02:00
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: bundle exec rails test
2024-07-23 20:40:31 +02:00
2024-07-24 01:48:27 +02:00
system-test:
2024-07-23 20:40:31 +02:00
runs-on: docker
name: Run system tests
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 .
2024-07-23 20:35:29 +02:00
- 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: |
2024-09-05 22:54:38 +02:00
${{ runner.os }}-repository
2024-07-23 20:35:29 +02:00
- 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