2024-08-17 09:21:48 -04:00

65 lines
1.9 KiB
YAML

name: Ci Actions worker
on:
push:
branches: [master]
jobs:
# job for testing CI inside code repo
checkout:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set env variable
run: echo "GIT_SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
process:
runs-on: ubuntu-latest
steps:
- name: run one line script
run: echo one line script
- name: runs a set of command using the runner shell
run: |
echo Add oher actions to build,
echo test, and deploy your project .
echo ""
check-vars:
needs: [process]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- run: echo "instance address is -> ${{ vars.GIT_INSTANCE_ADDRESS }} "
- run: echo "public key is -> ${{vars.GIT_SSH_PUBLIC_KEY }}"
check-secrets:
runs-on: ubuntu-latest
steps:
- run: echo "k8s config token ${{secrets.K8S_CONFIG }}"
create-artifact:
runs-on: ubuntu-latest
steps:
- name: create file
run: |
mkdir version
echo "v0.0.1" > version/version-$GIT_SHA_SHORT.txt
ls ${{ github.workspace}}
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: version-${{ env.GIT_SHA_SHORT }}.zip
path: version
download-artifact:
needs: [create-artifact]
runs-on: ubuntu-latest
steps:
- name: download artifact
uses: actions/download-artifact@v3
with:
name: version-${{ env.GIT_SHA_SHORT }}.zip
- name: list files
run: |
ls ${{ github.workspace }}
echo $GIT_SHA_SHORT
show-report-urlo:
needs: [download-artifact]
runs-on: ubuntu-latest
steps:
- name: External url creation
run: echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/run/$GITHUB_RUN_ID