Skip to content

Commit

Permalink
new github action for caps:api
Browse files Browse the repository at this point in the history
  • Loading branch information
paolini committed Jan 3, 2024
1 parent 42d0200 commit 2b34af7
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: JS tests
- name: build client webpack
run: |
cd frontend/
npm ci
npm run test
npm run deploy
npm run deploy:dev
- name: PHP tests
npm run js
- name: prepare server
run: |
cd backend/
php7.4 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php7.4 composer-setup.php
php7.4 -r "unlink('composer-setup.php');"
sudo apt-get -y install php-mbstring php-intl php-xml php-sqlite3 php-mysql php-zip php-ldap php-gd
php7.4 composer.phar -n install
bin/cake migrations migrate
php7.4 vendor/bin/phpunit --debug
- name: Pull previous Docker image
run: |
docker pull getcaps/caps:develop
cd api/
npm ci
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images: getcaps/caps
tags: |
type=ref,event=tag
type=ref,event=branch
type=semver,pattern={{version}}
- name: Login to DockerHub
images: harbor.cs.dm.unipi.it/caps/caps
tags: api
- name: Login to harbor
uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.HARBOR_CAPS_ROBOT }}
password: ${{ secrets.HARBOR_CAPS_SECRET }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
push: true
cache-from: type=registry,ref=getcaps/caps:develop
cache-from: type=registry,ref=harbor.cs.dm.unipi.it/caps/caps:api
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Trigger update on Watchtower
Expand Down

0 comments on commit 2b34af7

Please sign in to comment.