Skip to content

Build container workflow #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUS
# Configure zsh
RUN sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc

# Create a new conda environment with Python 3.12
# Create a new conda environment with Python 3.12 and fix the bug with VS-code terminal showing 2 conda env prompts
RUN . /opt/conda/etc/profile.d/conda.sh && \
conda config --set auto_activate_base False && \
/opt/conda/bin/conda create -n c312 python=3.12 -y && \
conda activate c312

Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Pyiqtree Devcontainer",
"context": "..",
"dockerFile": "Dockerfile",
"image": "ghcr.io/cogent3/piqtree2:latest",
"customizations": {
"vscode": {
"settings": {
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Push Docker images to GitHub Container Registry

on:
push:
branches:
- main
- develop
- build-container-workflow

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Build and Push Base Docker image
run: |
docker build -f .devcontainer/DockerFile . \
-t ghcr.io/${{ github.repository_owner }}/piqtree2:latest
docker push ghcr.io/${{ github.repository_owner }}/piqtree2:latest

Loading