Skip to content
name: Create and deploy a new release

Check failure on line 1 in .github/workflows/create-deploy-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-deploy-release.yml

Invalid workflow file

`never` is not a valid event name
run-name: create and deploy ${{ github.sha }}
on:
never: # never trigger for now
#push:
# branches:
# - create-deploy-release
jobs:
trigger-gitlab-pipeline:
runs-on: ubuntu-latest
env:
GITLAB_API_TOKEN: ${{ secrets.GITLAB_API_TOKEN }}
steps:
- name: configure environment
shell: bash
run: |
echo "REPO_PUBLIC_URL=${{ github.server_url }}/${{ github.repository }}.git" >> $GITHUB_ENV
echo "SCAFFOLD_DIR=scaffold" >> $GITHUB_ENV
- name: clone repositories
shell: bash
run: |
git clone --quiet --depth 1 $REPO_PUBLIC_URL ${{ vars.APP_NAME }}
git clone --quiet --depth 1 -b add-env https://oauth2:$GITLAB_API_TOKEN@${{ vars.SCAFFOLD_REPO_PUBLIC_URL }} ${{ env.SCAFFOLD_DIR }}
- name: configure environment
shell: bash
run: |
#LAST_COMMIT_MESSAGE=$(git log -1 --pretty=%s)
# for testing
LAST_COMMIT_MESSAGE="[demo:defis] (empty commit) trigger deployment"
if [[ $LAST_COMMIT_MESSAGE =~ ^\[(prod|demo):(ecospheres|meteo|defis)\] ]]; then
ENV="${BASH_REMATCH[1]}"
CONFIG_NAME="${BASH_REMATCH[2]}"
fi
echo "ENV=$ENV" >> $GITHUB_ENV
echo "CONFIG_NAME=$CONFIG_NAME" >> $GITHUB_ENV
working-directory: ${{ vars.APP_NAME }}
- name: trigger Gitlab CI/CD pipeline
shell: bash
run: |
RELEASE_VERSION="${GITHUB_SHA:0:8}"
./scripts/gitlab-ci-pipeline.sh ${{ env.REPO_PUBLIC_URL }} ${{ vars.APP_NAME }} $RELEASE_VERSION $ENV
working-directory: ${{ env.SCAFFOLD_DIR }}