-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from facorazza/container-image
Container image
- Loading branch information
Showing
6 changed files
with
117 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.github | ||
.gitignore | ||
README.md |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build container image | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
|
||
build_and_push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
- name: Set image tag | ||
id: image-tag | ||
run: | | ||
if [[ ${{ github.ref }} == refs/tags/* ]]; then | ||
echo "IMAGE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
elif [[ ${{ github.ref }} == refs/heads/main ]]; then | ||
echo "IMAGE_TAG=latest" >> $GITHUB_OUTPUT | ||
elif [[ ${{ github.ref }} == refs/heads/develop ]]; then | ||
echo "IMAGE_TAG=develop" >> $GITHUB_OUTPUT | ||
else | ||
echo "IMAGE_TAG=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: ghcr.io/facorazza/passwords2bitwarden:${{ steps.image-tag.outputs.IMAGE_TAG }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM python:3.13-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Create an output directory for the converted files | ||
RUN mkdir -p /app/output | ||
|
||
COPY requirements.txt /app | ||
|
||
RUN python -m pip install --no-cache-dir --user --disable-pip-version-check --upgrade pip | ||
RUN python -m pip install --no-cache-dir --user -r requirements.txt | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
|
||
# Make sure the main script is executable | ||
RUN chmod +x main.py | ||
|
||
# Default command for running the script, accepts zip file and output directory as arguments | ||
ENTRYPOINT ["python", "./main.py"] | ||
CMD ["/app/archive.zip", "/app/output"] |
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
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
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