Skip to content

curl test and remove mvn cache #15

curl test and remove mvn cache

curl test and remove mvn cache #15

name: Build and Push Docker Image
on:
push:
branches:
- docker
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: test curl
run: |
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/users/slow-groovin/packages/maven/com.github.action.test.github-package-upload-config
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'liberica'
#cache: maven
- name: run echo something
run: |
echo github.workspace:${{ github.workspace }}
echo github.repository:${{ github.repository }}
echo github.ref:${{ github.ref }}
echo version:$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout )
echo artifactId:$(mvn help:evaluate -Dexpression=project.artifactId -DforceStdout -q )
echo GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
echo MY_GH_SECRET_TOKEN:${{ secrets.MY_GH_SECRET_TOKEN }}
- name: Build with Maven
run: cd java && mvn -B package -P github -X
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: ./nodejs-project
push: true
tags: ghcr.io/${{ github.repository }}:latest