Skip to content
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

Refactor #3

Merged
merged 5 commits into from
Oct 24, 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
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test

on: [push]

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: docker build .

test:
needs: check

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Basic usage
uses: ./
with:
connection-string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
container: "azblob-generate-static-index"
prefix: "some"
overwrite: "true"

- name: Check if 'index.html' is correct
run: |
az storage blob download \
--connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}" \
--container-name azblob-generate-static-index \
--name some/index.html \
--file index.html.downloaded

grep -q 'hello.txt' index.html.downloaded
grep -q 'world.txt' index.html.downloaded
32 changes: 32 additions & 0 deletions .github/workflows/update-main-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Original version
# https://github.com/actions/checkout/blob/11bd71901bbe5b1630ceea73d27597364c9af683/.github/workflows/update-main-version.yml
name: Update Main Version
run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}

on:
workflow_dispatch:
inputs:
target:
description: The tag or reference to use
required: true
major_version:
type: choice
description: The major version to update
options:
- v1

jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git config
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Tag new target
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}
- name: Push new tag
run: git push origin ${{ github.event.inputs.major_version }} --force
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM alpine as mustache-downloader
FROM alpine AS mustache-downloader

RUN apk --update add curl tar

ARG MUSTACHE_VERSION=1.3.0
RUN curl -sSL https://github.com/cbroglie/mustache/releases/download/v${MUSTACHE_VERSION}/mustache_${MUSTACHE_VERSION}_linux_amd64.tar.gz \
ARG TARGETARCH
ARG MUSTACHE_VERSION=1.4.0
RUN curl -sSL https://github.com/cbroglie/mustache/releases/download/v${MUSTACHE_VERSION}/mustache_${MUSTACHE_VERSION}_linux_${TARGETARCH}.tar.gz \
| tar xzf - \
&& mv mustache /usr/local/bin/mustache

FROM mcr.microsoft.com/azure-cli

RUN apk --no-cache add jq

COPY --from=mustache-downloader /usr/local/bin/mustache /usr/local/bin/mustache
COPY docker-entrypoint.sh /docker-entrypoint.sh
COPY index.html.mustache /index.html.mustache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Get [Azure Storage connection strings](https://docs.microsoft.com/en-us/azure/st

```yaml
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- uses: fixpoint/azblob-generate-static-index@v1
with:
Expand Down