Skip to content

Commit

Permalink
Merge pull request #2 from kotaicode/add-script
Browse files Browse the repository at this point in the history
add workflow
  • Loading branch information
tomjosetj31 authored Oct 31, 2024
2 parents 0328d72 + d3ac66c commit fa6439c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/push-to-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push to GitHub Container Registry
run-name: Build and Push to GitHub Container Registry (${{ github.ref_name }} by @${{ github.actor }})

on:
push:
branches:
- master

# Cancel the workflow in progress in newer build is about to start.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name }}
permissions:
contents: write
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}/${{ github.ref_name }}
labels: ${{ github.sha }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM openjdk:17.0.1-jdk-slim
COPY --from=build /tmp/brouter/brouter-server/build/libs/brouter-*-all.jar /brouter.jar
COPY --from=build /tmp/brouter/misc/scripts/standalone/server.sh /bin/
COPY --from=build /tmp/brouter/misc/* /profiles2
COPY --from=build download_segments.sh .
COPY --from=build /tmp/brouter/download_segments.sh .

CMD /bin/server.sh

0 comments on commit fa6439c

Please sign in to comment.