Skip to content

op_test

op_test #2

Workflow file for this run

name: Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Push events to any matching semantic tag. For example, 1.10.1 or 2.0.0.
# For more details, see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
# and https://docs.npmjs.com/about-semantic-versioning
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: ENV
run: |
echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "DOCKER_IMAGE=tercen/${{ github.event.repository.name }}" >> $GITHUB_ENV
- name: Update container in operator JSON
run: |
jq --arg variable "$DOCKER_IMAGE:$TAG" '.container = $variable' operator.json
- name: Build docker image
run: |
docker build -t $DOCKER_IMAGE:$TAG .
# - name: docker login
# run: |
# docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }}
# - name: docker push
# run: |
# docker push $DOCKER_IMAGE:$TAG
# docker tag $DOCKER_IMAGE:$TAG $DOCKER_IMAGE:latest
# docker push $DOCKER_IMAGE:latest
# - name: Pull tercenctl
# run: docker pull tercen/tercenctl:release
# # - name: Install operator
# # run: |
# # docker run --rm \
# # -e TERCEN_USERNAME=${{ secrets.TERCEN_TEST_OPERATOR_USERNAME }} \
# # -e TERCEN_PASSWORD=${{ secrets.TERCEN_TEST_OPERATOR_PASSWORD }} \
# # -e TERCEN_URI=${{ secrets.TERCEN_TEST_OPERATOR_URI }} \
# # -e GITHUB_TOKEN=${GITHUB_TOKEN} \
# # tercen/tercenctl:release operator install --rm --tag ${TAG} --repo ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
# - name: Create required package.json
# run: echo '{}' > package.json
# - name: Build changelog
# id: Changelog
# uses: tercen/generate-changelog-action@master
# - name: Create release
# id: create_release
# uses: actions/create-release@latest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: ${{steps.Changelog.outputs.changelog}}
# draft: false
# prerelease: false