Skip to content

Commit

Permalink
Don't you just YAML it? πŸ˜…πŸš§
Browse files Browse the repository at this point in the history
  • Loading branch information
k0gen committed Sep 20, 2024
1 parent 2abae49 commit b494c54
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions .github/workflows/build-simplex-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,47 @@ jobs:
with:
platforms: all

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch latest tags from SimpleX repository
run: |
git clone --depth=1 --tags $REPO_URL
cd simplex-chat
# Find the latest tag, filtering out any non-version tags like 'v*'
LATEST_TAG=$(git tag -l --sort=-v:refname 'v*' | head -n 1)
echo "Latest tag found: $LATEST_TAG"
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Fetch latest tags from SimpleX repository
run: |
git clone --depth=1 --tags $REPO_URL
cd simplex-chat
# Find the latest tag, filtering out any non-version tags like 'v*'
LATEST_TAG=$(git tag -l --sort=-v:refname 'v*' | head -n 1)
echo "Latest tag found: $LATEST_TAG"
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Determine version to build
run: |
if [ "${{ github.event.inputs.simplex_version }}" == "latest" ]; then
echo "Using latest tag: $LATEST_TAG"
echo "SIMPLEX_VERSION=$LATEST_TAG" >> $GITHUB_ENV
else
echo "Using specified version: ${{ github.event.inputs.simplex_version }}"
echo "SIMPLEX_VERSION=${{ github.event.inputs.simplex_version }}" >> $GITHUB_ENV
- name: Determine version to build
run: |
if [ "${{ github.event.inputs.simplex_version }}" == "latest" ]; then
echo "Using latest tag: $LATEST_TAG"
echo "SIMPLEX_VERSION=$LATEST_TAG" >> $GITHUB_ENV
else
echo "Using specified version: ${{ github.event.inputs.simplex_version }}"
echo "SIMPLEX_VERSION=${{ github.event.inputs.simplex_version }}" >> $GITHUB_ENV
- name: Build and push Docker image for x86 and arm
run: |
echo "Building SimpleX version: $SIMPLEX_VERSION"
- name: Build and push Docker image for x86 and arm
run: |
echo "Building SimpleX version: $SIMPLEX_VERSION"
docker buildx build \
--platform linux/amd64,linux/arm64 \
--file .github/Dockerfile.simplex \
--tag ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:$SIMPLEX_VERSION \
--build-arg SIMPLEX_VERSION=$SIMPLEX_VERSION \
--push \
.
docker buildx build \
--platform linux/amd64,linux/arm64 \
--file .github/Dockerfile.simplex \
--tag ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:$SIMPLEX_VERSION \
--build-arg SIMPLEX_VERSION=$SIMPLEX_VERSION \
--push \
.
- name: Image build complete
run: echo "Docker image has been built and published."
- name: Image build complete
run: echo "Docker image has been built and published."

0 comments on commit b494c54

Please sign in to comment.