push to gitlab test branch #70
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: Publish and Deploy | |
on: | |
push: | |
branches: | |
- main | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: battmoteam/battmogui:latest | |
WORKDIR: battmogui | |
GITLAB_URL: "https://lorena.hendrix:${{ secrets.GITLAB_PAT}}@gitlab.sintef.no/FFP-products/prod/webapp-instances/102023526-1006.git" | |
jobs: | |
publish: | |
name: publish docker images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Login | |
run: echo ${{ secrets.PAT }} | docker login ghcr.io -u lorenah84 --password-stdin | |
- name: Build | |
run: | | |
docker-compose -f docker-compose-deploy.yml build | |
- name: Publish | |
run: docker-compose -f docker-compose-deploy.yml push | |
mirror: | |
name: mirror repository to GitLab | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Mirror changes | |
run: | | |
git remote add gitlab ${{ env.GITLAB_URL }} | |
git fetch origin main | |
git push gitlab main:test |