Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GraalVM Jibber Github Actions Pipeline (EE) | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: GraalVM Jibber on ${{ matrix.os }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: 'latest' | |
gds-token: ${{ secrets.GDS_TOKEN }} | |
java-version: '17' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Test Java Code | |
run: | | |
./mvnw --no-transfer-progress -Pnative -DskipNativeTests package | |
./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout > version.txt | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: | | |
version.txt | |
target/jibber | |
Dockerfiles/Dockerfile.native | |
retention-days: 1 | |
push_container: | |
name: Push Container to OCIR | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
env: | |
OCI_CLI_USER: ${{ secrets.OCI_USER_OCID }} | |
OCI_CLI_TENANCY: ${{ secrets.OCI_TENANCY_OCID }} | |
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_FINGERPRINT }} | |
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_KEY_FILE }} | |
OCI_CLI_REGION: ${{ secrets.OCI_REGION }} | |
OCI_CLI_COMPARTMENT: ${{ secrets.OCI_COMPARTMENT_OCID }} | |
steps: | |
- name: Get or create an OCIR Repository | |
uses: oracle-actions/[email protected] | |
id: get-ocir-repository | |
with: | |
name: demo | |
compartment: ${{ secrets.OCI_COMPARTMENT_OCID }} | |
- name: Log into OCIR | |
uses: oracle-actions/[email protected] | |
id: login-ocir | |
with: | |
auth_token: ${{ secrets.OCI_AUTH_TOKEN }} | |
- name: Download a single artifact | |
uses: actions/[email protected] | |
with: | |
name: dist | |
- name: Tag and push a container image | |
id: tag-and-push-image | |
run: | | |
export VER=`cat version.txt` | |
echo ${VER} | |
#echo "${{ steps.get-ocir-repository.outputs.repo_path }}:jibber_new.native.latest" > repo_path.txt | |
export REPO="${{ steps.get-ocir-repository.outputs.repo_path }}:jibber_new.native.${VER}.NEW" | |
echo ${REPO} | |
echo ${REPO} > repo_path.txt | |
docker pull oraclelinux:8-slim | |
docker build -t ${REPO} -f Dockerfiles/Dockerfile.native --build-arg APP_FILE=target/jibber . | |
docker push "${REPO}" | |
- name: Archive repo path | |
uses: actions/upload-artifact@v3 | |
with: | |
name: repo_path | |
path: | | |
repo_path.txt | |
retention-days: 1 | |
install-kubectl: | |
runs-on: ubuntu-latest | |
name: Install Kubectl for OKE | |
needs: [push_container] | |
if: github.ref == 'refs/heads/main' | |
env: | |
OCI_CLI_USER: ${{ secrets.OCI_USER_OCID }} | |
OCI_CLI_TENANCY: ${{ secrets.OCI_TENANCY_OCID }} | |
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_FINGERPRINT }} | |
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_KEY_FILE }} | |
OCI_CLI_REGION: ${{ secrets.OCI_REGION }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download a single artifact | |
uses: actions/[email protected] | |
with: | |
name: repo_path | |
- name: Configure Kubectl | |
uses: oracle-actions/[email protected] | |
id: test-configure-kubectl-oke-action | |
with: | |
cluster: ${{ secrets.OKE_CLUSTER_OCID }} | |
- name: Run Kubectl | |
run: kubectl get nodes -A | |
- name: Apply k8s config | |
run: | | |
ls -la | |
export IMG=`cat repo_path.txt` | |
kubectl apply -f k8s/namespace.yaml | |
IMG=`cat repo_path.txt` && envsubst < k8s/deployment.yaml | kubectl apply -f - |