with detached mode, we don't need to wait for the
tests to complete. Now, we can get inside tmate before
the tests start and we can monitor the tests.
By default, this mode will wait at the end of the job for
a user to connect and then to terminate the tmate session.
If no user has connected within 10 minutes after the post-job step started,
it will terminate the tmate session and quit gracefully.
Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit f171e1c037)
83 lines
2.3 KiB
YAML
83 lines
2.3 KiB
YAML
name: Push Image Build
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- release-*
|
|
tags:
|
|
- v*
|
|
|
|
defaults:
|
|
run:
|
|
# reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
|
|
shell: bash --noprofile --norc -eo pipefail -x {0}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
push-image-to-container-registry:
|
|
runs-on: ubuntu-20.04
|
|
if: github.repository == 'rook/rook'
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: consider debugging
|
|
uses: ./.github/workflows/tmate_debug
|
|
with:
|
|
use-tmate: ${{ secrets.USE_TMATE }}
|
|
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: "1.20"
|
|
|
|
# docker/setup-qemu action installs QEMU static binaries, which are used to run builders for architectures other than the host.
|
|
- name: set up QEMU
|
|
uses: docker/setup-qemu-action@master
|
|
with:
|
|
platforms: all
|
|
|
|
- name: log in to container registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Configure AWS Credentials
|
|
uses: aws-actions/configure-aws-credentials@v2
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_USR }}
|
|
aws-secret-access-key: ${{ secrets.AWS_PSW }}
|
|
aws-region: us-east-1
|
|
|
|
# creating custom env var
|
|
- name: set env
|
|
run: |
|
|
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
echo "GITHUB_REF"=${GITHUB_REF} >> $GITHUB_ENV
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python3 -m pip install --upgrade pip setuptools wheel
|
|
sudo apt-get -q update
|
|
sudo apt-get -q install -y python3-pygit2
|
|
|
|
- name: Configure git user
|
|
run: |
|
|
# Use our Rook "service account"
|
|
git config user.name Rook
|
|
git config user.email "cncf-rook-info@lists.cncf.io"
|
|
|
|
- name: build and release
|
|
env:
|
|
GIT_API_TOKEN: ${{ secrets.GIT_API_TOKEN }}
|
|
BRANCH_NAME: ${{ env.BRANCH_NAME }}
|
|
AWS_USR: ${{ secrets.AWS_USR }}
|
|
AWS_PSW: ${{ secrets.AWS_PSW }}
|
|
GITHUB_REF: $ {{ env.GITHUB_REF }}
|
|
run: |
|
|
tests/scripts/build-release.sh
|