Merge pull request #1054 from amvanbaren/fix-webresources #2150
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
SERVER_TAG: ghcr.io/eclipse/openvsx-server | |
WEBUI_TAG: ghcr.io/eclipse/openvsx-webui | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Install Yarn | |
run: | | |
corepack enable | |
corepack prepare yarn@stable --activate | |
- uses: actions/checkout@v4 | |
- name: Set Image Version | |
run: echo "IMAGE_VERSION=${GITHUB_SHA:0:7}" >> $GITHUB_ENV | |
- name: Build CLI | |
run: yarn --cwd cli | |
- name: Build Web UI Image | |
run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui | |
- name: Run Server Tests | |
run: server/gradlew --no-daemon -p server check | |
- name: Build Server Image | |
run: docker build -t $SERVER_TAG:$IMAGE_VERSION server | |
- name: Push Docker Images | |
run: | | |
echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
docker push $SERVER_TAG:$IMAGE_VERSION | |
docker push $WEBUI_TAG:$IMAGE_VERSION | |
if: github.repository == 'eclipse/openvsx' && github.ref == 'refs/heads/master' | |
- name: Save PR number to file | |
if: github.event_name == 'pull_request' | |
run: echo ${{ github.event.number }} > PR_NUMBER.txt | |
- name: Archive PR number | |
if: github.event_name == 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PR_NUMBER | |
path: PR_NUMBER.txt |