diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 31eaef3..c6bfb94 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -3,7 +3,6 @@ on: push: branches: # - 'master' - # - 'main' - '**' env: @@ -37,3 +36,15 @@ jobs: run: | . $(werf ci-env github --as-file) werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA + # stage-deploy: + # name: Deploy on stage + # needs: converge + # runs-on: ubuntu-latest + # steps: + # - name: ConfigCreate + # run: | + # mkdir ~/.kube/ + # echo "${{ secrets.KUBECONFIG }}" > config + # mv config ~/.kube/ + # ls ~/.kube/ + # kubectl set image deployment/solarity-stage-link-shortener link-shortener=ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA -n stage \ No newline at end of file diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml new file mode 100644 index 0000000..922a7b7 --- /dev/null +++ b/.github/workflows/tag.yaml @@ -0,0 +1,53 @@ +on: + workflow_dispatch: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +env: + CI_JOB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + converge: + name: Converge + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install werf + uses: werf/actions/install@v1.2 + + - name: Log in to registry + # This is where you will update the personal access token to GITHUB_TOKEN + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + + - name: Run echo + run: | + werf version + docker version + echo $GITHUB_REPOSITORY + echo $GITHUB_REF_NAME + - name: Run Build + run: | + . $(werf ci-env github --as-file) + werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME + # prod-deploy: + # name: Deploy on prod + # needs: converge + # runs-on: ubuntu-latest + # steps: + # - name: Run echo + # run: | + # echo "Tag was created - deploying on prod" + # echo tag = $GITHUB_REF_NAME + # - name: ConfigCreate + # run: | + # mkdir ~/.kube/ + # echo "${{ secrets.KUBECONFIG }}" > config + # mv config ~/.kube/ + # ls ~/.kube/ + # kubectl set image deployment/solarity-prod-link-shortener link-shortener=ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME -n prod \ No newline at end of file